[Mew-dist 13975] getopt_long (RE: Re: Microsoft Exel の添付)

KOIE Hidetaka ( 鯉江英隆 ) hide at example.com
2000年 8月 29日 (火) 14:45:33 JST


From: Kazu Yamamoto (山本和彦) <kazu at example.com>
Subject: [Mew-dist 13973] Re: Microsoft Exel の添付
Date: Tue, 29 Aug 2000 14:18:37 +0900

  | インチキ pick が mewls に入っていることに、どれくらいの人が気付いてい
  | るか?

以下のように引数があることを明示してやらないと
   mewls --pick to=xx  ⇒ ok.
   mewls -p to=xx      ⇒ optarg==NULLのためsegmentation fault
になります。
longoptsの4th attributeはlong optionからshort optionへの
マッピングにしか使わないんでしょうね、きっと。

--- mewls.c.org	Tue Aug 29 14:20:57 2000
+++ mewls.c	Tue Aug 29 14:33:04 2000
@@ -386,7 +386,7 @@
 	char *p;
 	int index = 0;
 
-	while ((optc = getopt_long(argc, argv, "fhnpsv", longopts, (int *)0)) != EOF)
+	while ((optc = getopt_long(argc, argv, "f:hnp:s:v", longopts, (int *)0)) != EOF)
 	{
 		switch (optc) {
 		case 'f':

--
KOIE Hidetaka 鯉江英隆 <hide at example.com>



Mew-dist メーリングリストの案内