diff --git a/gtk/about_dlg.c b/gtk/about_dlg.c index 498bc027bc..9adf8ecd48 100644 --- a/gtk/about_dlg.c +++ b/gtk/about_dlg.c @@ -40,10 +40,9 @@ #include "text_page.h" #endif -#include "svnversion.h" - #include "../image/eicon3d64.xpm" #include "gtkglobals.h" +#include "version_info.h" extern GString *comp_info_str, *runtime_info_str; @@ -156,10 +155,7 @@ about_ethereal_page_new(void) /* Construct the message string */ message = g_strdup_printf( - "Version " VERSION -#ifdef SVNVERSION - " (" SVNVERSION ")" -#endif + "Version " VERSION "%s" " (C) 1998-2005 Gerald Combs \n\n" "%s\n\n" "%s\n\n" @@ -167,7 +163,7 @@ about_ethereal_page_new(void) "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.", - comp_info_str->str, runtime_info_str->str); + svnversion, 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 30150bfa12..e33d622717 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -67,7 +67,6 @@ #include /* general (not GTK specific) */ -#include "svnversion.h" #include "file.h" #include "summary.h" #include "filters.h" @@ -1082,13 +1081,10 @@ print_usage(gboolean print_ver) { if (print_ver) { output = stdout; - fprintf(output, "This is "PACKAGE " " VERSION -#ifdef SVNVERSION - " (" SVNVERSION ")" -#endif + fprintf(output, "This is "PACKAGE " " VERSION "%s" "\n (C) 1998-2005 Gerald Combs " "\n\n%s\n\n%s\n", - comp_info_str->str, runtime_info_str->str); + svnversion, comp_info_str->str, runtime_info_str->str); } else { output = stderr; } diff --git a/tethereal.c b/tethereal.c index bb8c608800..92595f3275 100644 --- a/tethereal.c +++ b/tethereal.c @@ -59,8 +59,6 @@ #include "getopt.h" #endif -#include "svnversion.h" - #include #include #include @@ -220,14 +218,11 @@ print_usage(gboolean print_ver) if (print_ver) { output = stdout; - fprintf(output, "This is GNU t" PACKAGE " " VERSION -#ifdef SVNVERSION - " (" SVNVERSION ")" -#endif + fprintf(output, "This is GNU t" PACKAGE " " VERSION "%s" "\n (C) 1998-2005 Gerald Combs " "\n%s\n%s\n", - comp_info_str->str, runtime_info_str->str); + svnversion, comp_info_str->str, runtime_info_str->str); } else { output = stderr; } @@ -1000,12 +995,8 @@ main(int argc, char *argv[]) } break; case 'v': /* Show version and exit */ - printf("t" PACKAGE " " VERSION -#ifdef SVNVERSION - " (" SVNVERSION ")" -#endif - "\n%s\n%s\n", - comp_info_str->str, runtime_info_str->str); + printf("t" PACKAGE " " VERSION "%s\n%s\n%s\n", + svnversion, 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 0e6af95fe5..11a069113c 100644 --- a/version_info.c +++ b/version_info.c @@ -73,6 +73,15 @@ #include "version_info.h" #include "pcap-util.h" +#include "svnversion.h" + +#ifdef SVNVERSION + const char *svnversion = " (" SVNVERSION ")"; +#else + 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. diff --git a/version_info.h b/version_info.h index bcba136d2c..ada86b5863 100644 --- a/version_info.h +++ b/version_info.h @@ -30,6 +30,11 @@ extern "C" { #endif /* __cplusplus */ +/* + * The svn version string or "" + */ +const gchar *svnversion; + /* * Get various library compile-time versions and append them to * the specified GString.