Author: ycwu
Date: 2011-01-11 20:59:27 -0500 (Tue, 11 Jan 2011)
New Revision: 3454

Modified:
   trunk/osprey/driver/table.c
Log:
fixed bug #709
$cat test.c
main(){}

if directory libs did not exist

$ opencc -I ./libs test.c -o test
opencc WARNING: unknown flag: -I
gcc: ./libs: No such file or directory
$ ehco $?
1



Modified: trunk/osprey/driver/table.c
===================================================================
--- trunk/osprey/driver/table.c 2011-01-11 21:53:09 UTC (rev 3453)
+++ trunk/osprey/driver/table.c 2011-01-12 01:59:27 UTC (rev 3454)
@@ -827,7 +827,10 @@
                                   || options[i].syntax == 
needs_directory_or_null
 #endif
                                   ) {
-                               fprintf(f, "\tif 
(is_directory(next_string(argv,argi))) {\n");
+                         fprintf(f, "\tif 
(!is_directory(next_string(argv,argi)) && fullwarn)\n");
+                         fprintf(f, "\t\twarning(\"%%s is not a directory\", 
next_string(argv,argi));\n");
+                         fprintf(f, "\tif 
(strcmp(next_string(argv,argi),\"-default_options\")) {\n" );
+
                        }
                        fprintf(f, "\t\toptargs = get_optarg(argv, argi);\n");
                        if (options[i].syntax == needs_decimal) {
@@ -846,36 +849,6 @@
                          fprintf(f, "\t\treturn 
add_string_option(%s,optargs);\n", 
                                  options[i].flag);
                        fprintf(f, "\t\t/* NOTREACHED */\n");
-                       if (options[i].syntax == needs_directory
-#ifdef KEY
-                           || options[i].syntax == needs_directory_or_null
-#endif
-                           ) {
-                               fprintf(f, "\t} else if 
(!is_last_char(argv,argi)) {\n");
-                               fprintf(f, "\t\tif (fullwarn) {\n");
-                               fprintf(f, "\t\t\twarning(\"%%s does not refer 
to a valid directory\", option_name);\n");
-                               fprintf(f, "\t\t}\n");
-                               fprintf(f, "\t\toptargs = 
get_optarg(argv,argi);\n");
-                               fprintf(f, "\t\tget_next_arg(argi);\n");
-#ifdef KEY
-                               fprintf(f, "\t\treturn 
add_any_string_option(%s,optargs);\n", 
-                                       options[i].flag);
-#else
-                               fprintf(f, "\t\treturn 
add_string_option(%s,optargs);\n", 
-                                       options[i].flag);
-#endif
-                               fprintf(f, "\t\t/* NOTREACHED */\n");
-                       }
-#ifdef KEY
-                       // Ignore %D? option if no dir arg is found by changing
-                       // them into -dummy.
-                       if (options[i].syntax == needs_directory_or_null) {
-                               fprintf(f, "\t} else {\n");
-                               fprintf(f, "\t  optargs = 
current_string(argv,argi);\n");
-                               fprintf(f, "\t  get_next_arg(argi);\n");
-                               fprintf(f, "\t  return O_dummy;\n");
-                       }
-#endif
                        if (options[i].syntax != needs_string
                            && options[i].syntax != needs_string_or_dash
                                        ) {


------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to