From 07698d536b72f5267ebe654b0b0cbc394b713ce1 Mon Sep 17 00:00:00 2001 From: Bill Meier Date: Sun, 5 Oct 2014 22:14:57 -0400 Subject: Adjust some whitespace to match editor modelines. Change-Id: Ia22cac3ebd7a454c156f98d967e6fd61f708a2b3 Reviewed-on: https://code.wireshark.org/review/4489 Reviewed-by: Bill Meier --- wsutil/filesystem.c | 144 ++++++++++++++++++++++++++-------------------------- 1 file changed, 72 insertions(+), 72 deletions(-) (limited to 'wsutil/filesystem.c') diff --git a/wsutil/filesystem.c b/wsutil/filesystem.c index 99b3e5340e..57fea7baf1 100644 --- a/wsutil/filesystem.c +++ b/wsutil/filesystem.c @@ -1085,74 +1085,74 @@ static const char *extcap_dir = NULL; static void init_extcap_dir(void) { #ifdef _WIN32 - /* - * On Windows, the data file directory is the installation - * directory; the extcap hooks are stored under it. - * - * Assume we're running the installed version of Wireshark; - * on Windows, the data file directory is the directory - * in which the Wireshark binary resides. - */ - extcap_dir = g_strdup_printf("%s\\extcap\\%s", get_datafile_dir(), - VERSION); - - /* - * Make sure that pathname refers to a directory. - */ - if (test_for_directory(extcap_dir) != EISDIR) { - /* - * Either it doesn't refer to a directory or it - * refers to something that doesn't exist. - * - * Assume that means we're running a version of - * Wireshark we've built in a build directory, - * in which case {datafile dir}\plugins is the - * top-level extcap hooks source directory, and use - * that directory and set the "we're running in - * a build directory" flag, so the plugin - * scanner will check all subdirectories of that - * directory for extcap hooks. - */ - g_free( (gpointer) extcap_dir); - extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir()); - running_in_build_directory_flag = TRUE; - } + /* + * On Windows, the data file directory is the installation + * directory; the extcap hooks are stored under it. + * + * Assume we're running the installed version of Wireshark; + * on Windows, the data file directory is the directory + * in which the Wireshark binary resides. + */ + extcap_dir = g_strdup_printf("%s\\extcap\\%s", get_datafile_dir(), + VERSION); + + /* + * Make sure that pathname refers to a directory. + */ + if (test_for_directory(extcap_dir) != EISDIR) { + /* + * Either it doesn't refer to a directory or it + * refers to something that doesn't exist. + * + * Assume that means we're running a version of + * Wireshark we've built in a build directory, + * in which case {datafile dir}\plugins is the + * top-level extcap hooks source directory, and use + * that directory and set the "we're running in + * a build directory" flag, so the plugin + * scanner will check all subdirectories of that + * directory for extcap hooks. + */ + g_free( (gpointer) extcap_dir); + extcap_dir = g_strdup_printf("%s\\extcap", get_datafile_dir()); + running_in_build_directory_flag = TRUE; + } #else - if (running_in_build_directory_flag) { - /* - * We're (probably) being run from the build directory and - * weren't started with special privileges, so we'll use - * the "extcap hooks" subdirectory of the directory where the program - * we're running is (that's the build directory). - */ - extcap_dir = g_strdup_printf("%s/extcap", get_progfile_dir()); - } else { - if (getenv("WIRESHARK_EXTCAP_DIR") && !started_with_special_privs()) { - /* - * The user specified a different directory for extcap hooks - * and we aren't running with special privileges. - */ - extcap_dir = g_strdup(getenv("WIRESHARK_EXTCAP_DIR")); - } + if (running_in_build_directory_flag) { + /* + * We're (probably) being run from the build directory and + * weren't started with special privileges, so we'll use + * the "extcap hooks" subdirectory of the directory where the program + * we're running is (that's the build directory). + */ + extcap_dir = g_strdup_printf("%s/extcap", get_progfile_dir()); + } else { + if (getenv("WIRESHARK_EXTCAP_DIR") && !started_with_special_privs()) { + /* + * The user specified a different directory for extcap hooks + * and we aren't running with special privileges. + */ + extcap_dir = g_strdup(getenv("WIRESHARK_EXTCAP_DIR")); + } #ifdef __APPLE__ - /* - * If we're running from an app bundle and weren't started - * with special privileges, use the Contents/Resources/lib/wireshark/extcap - * subdirectory of the app bundle. - * - * (appbundle_dir is not set to a non-null value if we're - * started with special privileges, so we need only check - * it; we don't need to call started_with_special_privs().) - */ - else if (appbundle_dir != NULL) { - extcap_dir = g_strdup_printf("%s/Contents/Resources/lib/wireshark/extcap", - appbundle_dir); - } + /* + * If we're running from an app bundle and weren't started + * with special privileges, use the Contents/Resources/lib/wireshark/extcap + * subdirectory of the app bundle. + * + * (appbundle_dir is not set to a non-null value if we're + * started with special privileges, so we need only check + * it; we don't need to call started_with_special_privs().) + */ + else if (appbundle_dir != NULL) { + extcap_dir = g_strdup_printf("%s/Contents/Resources/lib/wireshark/extcap", + appbundle_dir); + } #endif - else { - extcap_dir = EXTCAP_DIR; - } - } + else { + extcap_dir = EXTCAP_DIR; + } + } #endif } #endif /* HAVE_EXTCAP */ @@ -1165,11 +1165,11 @@ static void init_extcap_dir(void) { const char * get_extcap_dir(void) { #if defined(HAVE_EXTCAP) - if (!extcap_dir) - init_extcap_dir(); - return extcap_dir; + if (!extcap_dir) + init_extcap_dir(); + return extcap_dir; #else - return NULL; + return NULL; #endif } @@ -1818,11 +1818,11 @@ get_datafile_path(const char *filename) { if (running_in_build_directory_flag && (!strcmp(filename, "AUTHORS-SHORT") || - !strcmp(filename, "hosts"))) { + !strcmp(filename, "hosts"))) { /* We're running in the build directory and the requested file is a * generated (or a test) file. Return the file name in the build - * directory (not in the source/data directory). - * (Oh the things we do to keep the source directory pristine...) + * directory (not in the source/data directory). + * (Oh the things we do to keep the source directory pristine...) */ return g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", get_progfile_dir(), filename); } else { -- cgit v1.2.1