> Alternatively, -P could be added when constructing the final command
> line. That would avoid both above-mentioned issues. New patch is
> included below.

Looks like the patch got lost, at least I don't see it in the list
archives. So here it is again:


http://bugs.freedesktop.org/show_bug.cgi?id=32701
http://bugs.gentoo.org/show_bug.cgi?id=347758

Signed-off-by: Ulrich Mueller <[email protected]>
---
 xrdb.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/xrdb.c b/xrdb.c
index 21005c0..75dfde7 100644
--- a/xrdb.c
+++ b/xrdb.c
@@ -1163,11 +1163,11 @@ Process(int scrno, Bool doScreen, Bool execute)
            fclose(input);
            (void) mktemp(tmpname3);
            if((cmd = (char *)
-               malloc(strlen(cpp_program) + strlen(includes.val) +
+               malloc(strlen(cpp_program) + 3 + strlen(includes.val) +
                       1 + strlen(tmpname2) + 3 + strlen(tmpname3) + 1)) ==
               NULL)
                fatal("%s: Out of memory\n", ProgramName);
-           sprintf(cmd, "%s%s %s > %s", cpp_program, includes.val,
+           sprintf(cmd, "%s -P%s %s > %s", cpp_program, includes.val,
                    tmpname2, tmpname3);
            if (system(cmd) < 0)
                fatal("%s: cannot run '%s'\n", ProgramName, cmd);
@@ -1182,10 +1182,10 @@ Process(int scrno, Bool doScreen, Bool execute)
            fflush(stdin);
            fseek(stdin, 0, 0);
            if((cmd = (char *)
-               malloc(strlen(cpp_program) + strlen(includes.val) + 1)) ==
+               malloc(strlen(cpp_program) + 3 + strlen(includes.val) + 1)) ==
               NULL)
                fatal("%s: Out of memory\n", ProgramName);
-           sprintf(cmd, "%s%s", cpp_program, includes.val);
+           sprintf(cmd, "%s -P%s", cpp_program, includes.val);
            if (!(input = popen(cmd, "r")))
                fatal("%s: cannot run '%s'\n", ProgramName, cmd);
            free(cmd);
@@ -1200,13 +1200,13 @@ Process(int scrno, Bool doScreen, Bool execute)
 #ifdef WIN32
            (void) mktemp(tmpname3);
            if((cmd = (char *)
-               malloc(strlen(cpp_program) + strlen(includes.val) +
+               malloc(strlen(cpp_program) + 3 + strlen(includes.val) +
                       1 + strlen(defines.val) + 1 +
                       strlen(filename ? filename : "") + 3 +
                       strlen(tmpname3) + 1)) ==
               NULL)
                fatal("%s: Out of memory\n", ProgramName);
-           sprintf(cmd, "%s%s %s %s > %s", cpp_program,
+           sprintf(cmd, "%s -P%s %s %s > %s", cpp_program,
                    includes.val, defines.val,
                    filename ? filename : "", tmpname3);
            if (system(cmd) < 0)
@@ -1216,12 +1216,12 @@ Process(int scrno, Bool doScreen, Bool execute)
                fatal("%s: can't open file '%s'\n", ProgramName, tmpname3);
 #else
            if((cmd = (char *)
-               malloc(strlen(cpp_program) + strlen(includes.val) + 1 +
+               malloc(strlen(cpp_program) + 3 + strlen(includes.val) + 1 +
                       strlen(defines.val) + 1 +
                       strlen(filename ? filename : "") + 1)) ==
               NULL)
                fatal("%s: Out of memory\n", ProgramName);
-           sprintf(cmd, "%s%s %s %s", cpp_program,
+           sprintf(cmd, "%s -P%s %s %s", cpp_program,
                    includes.val, defines.val,
                    filename ? filename : "");
            if (!(input = popen(cmd, "r")))
-- 
1.7.3.4
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to