Wireshark-commits: [Wireshark-commits] master-2.2 b011353: Clean up initialization code for program
From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Sat, 21 Jan 2017 16:06:30 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=b01135387e7c411c4150da498833f0e1a780b97c
Submitter: Jaap Keuter (jaap.keuter@xxxxxxxxx)
Changed: branch: master-2.2
Repository: wireshark

Commits:

b011353 by Guy Harris (guy@xxxxxxxxxxxx):

    Clean up initialization code for programs.
    
    Make the init_progfile_dir() call unconditionally, even if plugins
    aren't supported, as that doesn't necessarily mean nobody uses the
    directory containing the executable.
    
    Report the error the same way in all programs, and free the error string
    after we're finished with it.
    
    Make the error - and the comment before the code - reflect what
    init_progfile_dir() is actually doing (the goal is to get the full
    pathname of the directory *containing* the executable; that's generally
    done by getting the pathname of the executable and stripping off the
    name of the executable, but that's won't necessarily always be the
    case).  Also note for TShark that we won't be able to capture traffic,
    just as we do for Wireshark (if we don't have the pathname of the
    program file, we don't have a pathname to use to find dumpcap).
    
    Have the plugin scanner just fail silently if we weren't able to get the
    plugin directory path, so we don't have to worry about calling it if
    init_progfile_dir() fails.
    
    Clean up white space while we're at it.
    
    Change-Id: I8e580c719aab6fbf74a764bf6629962394fff7c8
    Reviewed-on: https://code.wireshark.org/review/19076
    Reviewed-by: Guy Harris <guy@xxxxxxxxxxxx>
    (cherry picked from commit 037c64aa34d4196da5a39dfb59af16abceb1247b)
    Reviewed-on: https://code.wireshark.org/review/19720
    Petri-Dish: Jaap Keuter <jaap.keuter@xxxxxxxxx>
    Tested-by: Petri Dish Buildbot <buildbot-no-reply@xxxxxxxxxxxxx>
    Reviewed-by: Jaap Keuter <jaap.keuter@xxxxxxxxx>
    

Actions performed:

    from  be1d4be   Have a routine to do all the work of initializing libwiretap.
    adds  b011353   Clean up initialization code for programs.


Summary of changes:
 capinfos.c       |   33 +++++++++++++++++++--------------
 captype.c        |   34 +++++++++++++++++++---------------
 dftest.c         |    6 ++++--
 editcap.c        |   33 +++++++++++++++++++--------------
 mergecap.c       |   35 +++++++++++++++++++----------------
 randpkt.c        |   34 +++++++++++++++++++---------------
 rawshark.c       |    3 ++-
 reordercap.c     |   44 ++++++++++++++++++++++++--------------------
 tfshark.c        |    7 +++++--
 tshark.c         |    9 +++++++--
 ui/gtk/main.c    |    5 +++--
 wireshark-qt.cpp |    3 ++-
 wsutil/plugins.c |    9 +++++++--
 13 files changed, 149 insertions(+), 106 deletions(-)