diff options
author | Guy Harris <guy@alum.mit.edu> | 2005-12-21 08:59:52 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2005-12-21 08:59:52 +0000 |
commit | c9b702ba1af50d483d5cd8048bb808a2f577e6b8 (patch) | |
tree | 7902e04f919aedffa340a284a670ed1324f7526b | |
parent | 8aca1c1c529878989aebfe6c1d3f9c5e0c8dc531 (diff) | |
download | wireshark-c9b702ba1af50d483d5cd8048bb808a2f577e6b8.tar.gz wireshark-c9b702ba1af50d483d5cd8048bb808a2f577e6b8.tar.bz2 wireshark-c9b702ba1af50d483d5cd8048bb808a2f577e6b8.zip |
Provide not only copyright information, but a GPL blurb, in all the
version/usage messages.
Put newlines at the end of various version strings.
svn path=/trunk/; revision=16870
-rw-r--r-- | gtk/about_dlg.c | 20 | ||||
-rw-r--r-- | gtk/main.c | 24 | ||||
-rw-r--r-- | tethereal.c | 26 | ||||
-rw-r--r-- | version_info.c | 30 | ||||
-rw-r--r-- | version_info.h | 5 |
5 files changed, 83 insertions, 22 deletions
diff --git a/gtk/about_dlg.c b/gtk/about_dlg.c index 68d464f900..1ce192618b 100644 --- a/gtk/about_dlg.c +++ b/gtk/about_dlg.c @@ -151,15 +151,19 @@ about_ethereal_page_new(void) /* Construct the message string */ message = g_strdup_printf( - "Version " VERSION "%s" - " (C) 1998-2005 Gerald Combs <gerald@ethereal.com>\n\n" - "%s\n\n" - "%s\n\n" - - "Ethereal is Open Source Software released under the GNU General Public License.\n\n" - + "Version " VERSION "%s\n" + "\n" + "%s" + "\n" + "%s" + "\n" + "%s" + "\n" + "Ethereal is Open Source Software released under the GNU General Public License.\n" + "\n" "Check the man page and http://www.ethereal.com for more information.", - svnversion, comp_info_str->str, runtime_info_str->str); + svnversion, get_copyright_info(), comp_info_str->str, + runtime_info_str->str); msg_label = gtk_label_new(message); g_free(message); diff --git a/gtk/main.c b/gtk/main.c index cfdedb7e5b..fb786c74b0 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1081,10 +1081,15 @@ print_usage(gboolean print_ver) { if (print_ver) { output = stdout; - fprintf(output, "This is "PACKAGE " " VERSION "%s" - "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>" - "\n\n%s\n\n%s\n", - svnversion, comp_info_str->str, runtime_info_str->str); + fprintf(output, "This is "PACKAGE " " VERSION "%s\n" + "\n" + "%s" + "\n" + "%s" + "\n" + "%s", + svnversion, get_copyright_info(), comp_info_str->str, + runtime_info_str->str); } else { output = stderr; } @@ -1119,8 +1124,15 @@ show_version(void) create_console(); #endif - printf(PACKAGE " " VERSION "%s\n\n%s\n\n%s\n", - svnversion, comp_info_str->str, runtime_info_str->str); + printf(PACKAGE " " VERSION "%s\n" + "\n" + "%s" + "\n" + "%s" + "\n" + "%s", + svnversion, get_copyright_info(), comp_info_str->str, + runtime_info_str->str); #ifdef _WIN32 destroy_console(); diff --git a/tethereal.c b/tethereal.c index 8f004c2502..fd371acc2c 100644 --- a/tethereal.c +++ b/tethereal.c @@ -194,11 +194,16 @@ print_usage(gboolean print_ver) if (print_ver) { output = stdout; - fprintf(output, "This is t" PACKAGE " " VERSION "%s" - "\n (C) 1998-2005 Gerald Combs <gerald@ethereal.com>" - "\n%s\n%s\n", - - svnversion, comp_info_str->str, runtime_info_str->str); + fprintf(output, "This is t" PACKAGE " " VERSION "%s\n" + "\n" + "%s" + "\n" + "%s" + "\n" + "%s", + + svnversion, get_copyright_info(), comp_info_str->str, + runtime_info_str->str); } else { output = stderr; } @@ -952,8 +957,15 @@ main(int argc, char *argv[]) } break; case 'v': /* Show version and exit */ - printf("t" PACKAGE " " VERSION "%s\n%s\n%s\n", - svnversion, comp_info_str->str, runtime_info_str->str); + printf("t" PACKAGE " " VERSION "%s\n" + "\n" + "%s" + "\n" + "%s" + "\n" + "%s", + svnversion, get_copyright_info(), comp_info_str->str, + runtime_info_str->str); exit(0); break; case 'w': /* Write to capture file xxx */ diff --git a/version_info.c b/version_info.c index 954b05379e..c2de660309 100644 --- a/version_info.c +++ b/version_info.c @@ -81,7 +81,6 @@ const char *svnversion = ""; #endif - /* * See whether the last line in the string goes past column 80; if so, * replace the blank at the specified point with a newline. @@ -103,6 +102,19 @@ do_word_wrap(GString *str, gint point) } /* + * If the string doesn't end with a newline, append one. + */ +static void +end_string(GString *str) +{ + size_t point; + + point = strlen(str->str); + if (point == 0 || str->str[point - 1] != '\n') + g_string_append(str, "\n"); +} + +/* * Get various library compile-time versions and append them to * the specified GString. */ @@ -201,6 +213,8 @@ get_compiled_version_info(GString *str) "\nsyntax."); do_word_wrap(str, break_point); #endif /* HAVE_LIBPCRE */ + + end_string(str); } /* @@ -373,4 +387,18 @@ get_runtime_version_info(GString *str) g_string_append(str, "an unknown OS"); #endif g_string_append(str, "."); + + end_string(str); +} + +/* + * Get copyright information. + */ +const char * +get_copyright_info(void) +{ + return +"Copyright 1998-2005 Gerald Combs <gerald@ethereal.com>.\n" +"This is free software; see the source for copying conditions. There is NO\n" +"warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"; } diff --git a/version_info.h b/version_info.h index ada86b5863..6d0f58810f 100644 --- a/version_info.h +++ b/version_info.h @@ -47,6 +47,11 @@ void get_compiled_version_info(GString *str); */ void get_runtime_version_info(GString *str); +/* + * Get copyright information. + */ +const char *get_copyright_info(void); + #ifdef __cplusplus } #endif /* __cplusplus */ |