[PATCH] wrc: handle "no files == stdin"

Marcus Meissner marcus at jet.franken.de
Sat Aug 8 04:00:36 CDT 2009


Hi,

when no files are passed in, use stdin.

Ciao, Marcus
---
 tools/wrc/wrc.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/tools/wrc/wrc.c b/tools/wrc/wrc.c
index 6a856eb..466b613 100644
--- a/tools/wrc/wrc.c
+++ b/tools/wrc/wrc.c
@@ -514,6 +514,15 @@ int main(int argc,char *argv[])
             }
             if (load_file( input_name, output_name )) exit(1);
         }
+	/* stdin special case. NULL means "stdin" for wpp. */
+        if (nb_files == 0) { 
+            if(!output_name && !preprocess_only)
+            {
+		output_name = dup_basename("stdin", ".rc");
+		strcat(output_name, ".res");
+            }
+            if (load_file( NULL, output_name )) exit(1);
+        }
 
 	if(debuglevel & DEBUGLEVEL_DUMP)
 		dump_resources(resource_top);
-- 
1.5.6



More information about the wine-patches mailing list