|
 |
cd7f69 |
From aeabf7344efeb20f515e804d3acc830730d9433b Mon Sep 17 00:00:00 2001
|
|
 |
cd7f69 |
From: Adam Jackson <ajax@redhat.com>
|
|
 |
cd7f69 |
Date: Tue, 21 Jul 2015 09:45:27 -0400
|
|
 |
cd7f69 |
Subject: [PATCH] Default to -nocpp, add -cpp default
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
|
 |
cd7f69 |
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
|
|
 |
cd7f69 |
---
|
|
 |
cd7f69 |
xrdb.c | 16 +++++++++++-----
|
|
 |
cd7f69 |
1 file changed, 11 insertions(+), 5 deletions(-)
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
diff --git a/xrdb.c b/xrdb.c
|
|
 |
cd7f69 |
index 24a6aa5..599edb7 100644
|
|
 |
cd7f69 |
--- a/xrdb.c
|
|
 |
cd7f69 |
+++ b/xrdb.c
|
|
 |
cd7f69 |
@@ -746,8 +746,8 @@ Syntax (void)
|
|
 |
cd7f69 |
" -screen do screen-specific resources for one screen\n"
|
|
 |
cd7f69 |
" -screens do screen-specific resources for all screens\n"
|
|
 |
cd7f69 |
" -n show but don't do changes\n"
|
|
 |
cd7f69 |
- " -cpp filename preprocessor to use [%s]\n"
|
|
 |
cd7f69 |
- " -nocpp do not use a preprocessor\n"
|
|
 |
cd7f69 |
+ " -cpp filename preprocessor to use [%s if \"default\" given]\n"
|
|
 |
cd7f69 |
+ " -nocpp do not use a preprocessor [default]\n"
|
|
 |
cd7f69 |
" -query query resources\n"
|
|
 |
cd7f69 |
" -load load resources from file [default]\n"
|
|
 |
cd7f69 |
" -override add in resources from file\n"
|
|
 |
cd7f69 |
@@ -761,7 +761,7 @@ Syntax (void)
|
|
 |
cd7f69 |
" -Dname[=value], -Uname, -Idirectory passed to preprocessor\n"
|
|
 |
cd7f69 |
"\n"
|
|
 |
cd7f69 |
"A - or no input filename represents stdin.\n",
|
|
 |
cd7f69 |
- ProgramName, cpp_program ? cpp_program : "", BACKUP_SUFFIX);
|
|
 |
cd7f69 |
+ ProgramName, cpp_program ? cpp_program : "none", BACKUP_SUFFIX);
|
|
 |
cd7f69 |
exit (1);
|
|
 |
cd7f69 |
}
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
@@ -855,6 +855,7 @@ main(int argc, char *argv[])
|
|
 |
cd7f69 |
int retainProp = 0;
|
|
 |
cd7f69 |
FILE *fp = NULL;
|
|
 |
cd7f69 |
Bool need_newline;
|
|
 |
cd7f69 |
+ char *cpp = NULL;
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
ProgramName = argv[0];
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
@@ -913,13 +914,16 @@ main(int argc, char *argv[])
|
|
 |
cd7f69 |
continue;
|
|
 |
cd7f69 |
} else if (isabbreviation ("-cpp", arg, 2)) {
|
|
 |
cd7f69 |
if (++i >= argc) Syntax ();
|
|
 |
cd7f69 |
- cpp_program = argv[i];
|
|
 |
cd7f69 |
+ if (!strcmp(argv[i], "default"))
|
|
 |
cd7f69 |
+ cpp = cpp_program;
|
|
 |
cd7f69 |
+ else
|
|
 |
cd7f69 |
+ cpp = argv[i];
|
|
 |
cd7f69 |
continue;
|
|
 |
cd7f69 |
} else if (!strcmp ("-n", arg)) {
|
|
 |
cd7f69 |
dont_execute = True;
|
|
 |
cd7f69 |
continue;
|
|
 |
cd7f69 |
} else if (isabbreviation ("-nocpp", arg, 3)) {
|
|
 |
cd7f69 |
- cpp_program = NULL;
|
|
 |
cd7f69 |
+ cpp = NULL;
|
|
 |
cd7f69 |
continue;
|
|
 |
cd7f69 |
} else if (isabbreviation ("-query", arg, 2)) {
|
|
 |
cd7f69 |
oper = OPQUERY;
|
|
 |
cd7f69 |
@@ -991,6 +995,8 @@ main(int argc, char *argv[])
|
|
 |
cd7f69 |
else
|
|
 |
cd7f69 |
filename = arg;
|
|
 |
cd7f69 |
} /* end for */
|
|
 |
cd7f69 |
+
|
|
 |
cd7f69 |
+ cpp_program = cpp;
|
|
 |
cd7f69 |
|
|
 |
cd7f69 |
#ifndef WIN32
|
|
 |
cd7f69 |
while ((i = open("/dev/null", O_RDONLY)) < 3)
|
|
 |
cd7f69 |
--
|
|
 |
cd7f69 |
2.4.3
|
|
 |
cd7f69 |
|