Author: dcoakley
Date: 2010-12-20 22:58:25 -0500 (Mon, 20 Dec 2010)
New Revision: 3442

Modified:
   trunk/osprey/driver/main.c
Log:
Fix handling of -x option in combination with stdin input.

The test case is:

 echo '#define TRUE 1' | opencc -c -x assembler-with-cpp -

This would result in an error similar to the following:

 gcc: /tmp/cci#.V9rs9c.s: No such file or directory
 gcc: no input files

The fix is to avoid resetting the source_lang if it has already been
set by the -x option.

Approved by: Sun Chan


Modified: trunk/osprey/driver/main.c
===================================================================
--- trunk/osprey/driver/main.c  2010-12-20 19:43:33 UTC (rev 3441)
+++ trunk/osprey/driver/main.c  2010-12-21 03:58:25 UTC (rev 3442)
@@ -404,7 +404,8 @@
                        } else {
                                char *obj_name;
                                source_kind = get_source_kind(source_file);
-                               source_lang = invoked_lang;
+                               if (source_lang == L_NONE)
+                                   source_lang = invoked_lang;
                                obj_name = get_object_file(
                                    fix_name_by_lang(source_file));
                                add_object (O_object, obj_name);


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to