[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[freewnn:00583] jserver -v option & bug fix



jserver にバージョン番号を表示するオプション -v をつけてみました.
(本当は getopt_long も使うようにしてみたいが…)
その際,Xsi/Wnn/jserver/de.c のグローバルな配列 cmd_name に
値を設定してなかったようなので,argv[0] をコピーするようにしてみました.

# 矢吹洋一@SRA Linux ソリューション部 --- まだまだ問題山積 ---
Index: de.c
===================================================================
RCS file: /home/yabuki/src/cvsroot/freewnn/Xsi/Wnn/jserver/de.c,v
retrieving revision 1.10
diff -u -p -r1.10 de.c
--- de.c	2001/05/13 05:50:26	1.10
+++ de.c	2001/05/22 03:26:38
@@ -214,6 +214,7 @@ main (argc, argv)
   port = -1;
 
   setuid (geteuid ());
+  strcpy (cmd_name, argv[0]);
 /* check whether another jserver already exists. */
   get_options (argc, argv);
 #ifdef  CHINESE
@@ -1052,7 +1053,7 @@ get_options (argc, argv)
 
   strcpy (jserverrcfile, LIBDIR);       /* usr/local/lib/wnn */
   strcat (jserverrcfile, SERVER_INIT_FILE);     /* ja_JP/jserverrc */
-  while ((c = getopt (argc, argv, "f:s:h:N:p:")) != EOF)
+  while ((c = getopt (argc, argv, "f:s:h:N:p:v")) != EOF)
     {
       switch (c)
         {
@@ -1080,8 +1081,19 @@ get_options (argc, argv)
         case 'p':
           port = atoi (optarg);
           break;
+        case 'v':
+#ifdef  CHINESE
+  printf ("%s %s(Chinese Multi Client Server)\n", cmd_name, SER_VERSION);
+#else
+# ifdef KOREAN
+  printf ("%s %s(Korean Multi Client Server)\n", cmd_name, SER_VERSION);
+# else
+  printf ("%s %s(Nihongo Multi Client Server)\n", cmd_name, SER_VERSION);
+#endif /* KOREAN */
+#endif /* CHINESE */
+	  exit (0);
         default:
-          printf ("usage: %s [-F <fuzokugo file> -f <initialize-file> -s <script-file(\"-\" for stderr)> -h <hinsi_file> -N <server-NO> -p <port>] \n", cmd_name);
+          printf ("usage: %s [-F <fuzokugo file> -f <initialize-file> -s <script-file(\"-\" for stderr)> -h <hinsi_file> -N <server-NO> -p <port> -v] \n", cmd_name);
           exit (1);
         }
     }


http://www.freewnn.org/ FreeWnn Project