Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle value append mode in addProtoField #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kahlkevin
Copy link
Contributor

  • Wireshark Wiki LuaAPI/TreeItem page says of :add's text arguments:

Additional strings (or numbers) to be appended to the value text.
If multiple text arguments are provided, they are all concatenated
with a space delimiter to form a single string. Any text arguments
that are not strings or numbers are ignored (including nil)."

If text1 is a string type, all text arguments (including text1)
overwrite the full text of the TreeItem rather than appending to the
existing text. So, use nil for text1 to append the remaining
arguments to the value text.
(By design? A bug turned feature?)"

  • This commit fixes two problems:
    • nils should be ignored, but weren't being skipped
    • append vs overwrite when text1 is nil

 - Wireshark Wiki LuaAPI/TreeItem page says of :add's text arguments:

   "Additional strings (or numbers) to be appended to the value text.
   If multiple text arguments are provided, they are all concatenated
   with a space delimiter to form a single string. Any text arguments
   that are not strings or numbers are ignored (including nil)."

   "If text1 is a string type, all text arguments (including text1)
   overwrite the full text of the TreeItem rather than appending to the
   existing text. So, use nil for text1 to append the remaining
   arguments to the value text. (By design? A bug turned feature?)"

 - This commit fixes two problems:
    + nils should be ignored, but weren't
    + append vs overwrite when text1 is nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant