Provide not only copyright information, but a GPL blurb, in all the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 21 Dec 2005 08:59:52 +0000 (08:59 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 21 Dec 2005 08:59:52 +0000 (08:59 +0000)
version/usage messages.

Put newlines at the end of various version strings.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16870 f5534014-38df-0310-8fa8-9805f1628bb7

gtk/about_dlg.c
gtk/main.c
tethereal.c
version_info.c
version_info.h

index 68d464f900477f5546580fcb1b0c9e879dcd5b82..1ce192618b26c5c626ec2b238cbfb81438e8acb0 100644 (file)
@@ -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);
index cfdedb7e5ba55e26ce911abd4ecdc20e704afdc7..fb786c74b03779d31419fec3dce9cc6d4dafe557 100644 (file)
@@ -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();
index 8f004c2502780c0e23d84b84eba60fdd42793844..fd371acc2ceed0feb64fea59ee2f848a4cf8d46e 100644 (file)
@@ -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 */
index 954b05379e02bb72b60be657b87c780e42873585..c2de660309763e6f21c9ca1f3f95ab4a1635a5ea 100644 (file)
@@ -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.
@@ -102,6 +101,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";
 }
index ada86b586333cf2f0c2a3cc58b20e7db19671d08..6d0f58810fc06a02527384872b649b722d002468 100644 (file)
@@ -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 */