# HG changeset patch
# Parent e154b7f823a4e9f17cac6401d7d1d8b642b92005
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -52,10 +52,15 @@
 #endif
 
 #endif // UNX
+
+#include <rtl/strbuf.hxx>
+#include <sal/main.h>
+
+#include <tools/fsys.hxx>
+
 #include <rsctools.hxx>
 #include <rscerror.h>
-#include <sal/main.h>
-#include <tools/fsys.hxx>
+
 
 /*************** C O D E ************************************************/
 /****************************************************************/
@@ -128,8 +133,29 @@ static BOOL CallPrePro( const ByteString
 		}
 	}
 
-	aNewCmdL.Append( rsc_strdup( rInput.GetBuffer() ) );
-	aNewCmdL.Append( rsc_strdup( rOutput.GetBuffer() ) );
+    ::rtl::OStringBuffer input(rInput.Len()+3);
+    if (fRspFile)
+    {
+        input.append('"');
+    }
+    input.append(rInput);
+    if (fRspFile)
+    {
+        input.append('"');
+    }
+    ::rtl::OStringBuffer output(rOutput.Len()+3);
+    if (fRspFile)
+    {
+        output.append('"');
+    }
+    output.append(rOutput);
+    if (fRspFile)
+    {
+        output.append('"');
+    }
+
+    aNewCmdL.Append( rsc_strdup( input.getStr() ) );
+    aNewCmdL.Append( rsc_strdup( output.getStr() ) );
 	aNewCmdL.Append( (void *)0 );
 
     if ( bVerbose )
@@ -258,7 +284,7 @@ static BOOL CallRsc2( ByteString aRsc2Na
 #ifdef OS2
 		fprintf( fRspFile, "%s\n", aSrsName.GetBuffer() );
 #else
-		fprintf( fRspFile, aSrsName.GetBuffer() );
+        fprintf( fRspFile, "%s", aSrsName.GetBuffer() );
 #endif
 
 		pString = pInputList->First();
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -410,10 +410,19 @@ readoptions(char* filename, char*** pfar
                 else
                 {
                     *poptbuff=EOS;
-                    if (strlen(optbuff)>0)
+                    size_t const len = strlen(optbuff);
+                    if (len > 0)
                     {
-                        pfa[fargc+1]=malloc(strlen(optbuff)+1);
-                        strcpy(pfa[fargc+1],optbuff);
+                        pfa[fargc+1] = malloc(len+1);
+                        if (('"' == optbuff[0]) && ('"' == optbuff[len-1]))
+                        {   // do not copy "s
+                            strncpy(pfa[fargc+1], optbuff+1, len-1);
+                            pfa[fargc+1][len-2] = '\0';
+                        }
+                        else
+                        {
+                            strcpy(pfa[fargc+1],optbuff);
+                        }
                         fargc++;
                         pfa[fargc+1]=0;
                         poptbuff=&optbuff[0];
