CVS commit: xsrc/external/mit/xrdb/dist

2016-04-24 Thread Christos Zoulas
Module Name:xsrc
Committed By:   christos
Date:   Sun Apr 24 18:22:49 UTC 2016

Modified Files:
xsrc/external/mit/xrdb/dist: xrdb.c

Log Message:
CID 1358678: Don't pass -1 to fdopen(3)


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 xsrc/external/mit/xrdb/dist/xrdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.7 xsrc/external/mit/xrdb/dist/xrdb.c:1.8
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.7	Mon Mar 17 06:03:20 2014
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Sun Apr 24 14:22:49 2016
@@ -1225,7 +1225,7 @@ Process(int scrno, Bool doScreen, Bool e
 #else
 	{
 	int fd = mkstemp(template);
-	output = fdopen(fd, "w");
+	output = fd != -1 ? fdopen(fd, "w") : NULL;
 	}
 #endif
 	if (!output)



CVS commit: xsrc/external/mit/xrdb/dist

2013-07-19 Thread Patrick Welche
Module Name:xsrc
Committed By:   prlw1
Date:   Fri Jul 19 08:29:24 UTC 2013

Modified Files:
xsrc/external/mit/xrdb/dist: xrdb.c

Log Message:
Replace mrg's clean cpp+cpp_arg interface with xrdb version 420347005c
to minimise upstream differences.
OK wiz@


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/xrdb/dist/xrdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.5 xsrc/external/mit/xrdb/dist/xrdb.c:1.6
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.5	Wed Apr  6 02:07:24 2011
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Fri Jul 19 08:29:24 2013
@@ -120,17 +120,13 @@ static char *filename = NULL;
 #ifdef PATHETICCPP
 static Bool need_real_defines = False;
 static char tmpname2[32];
+#endif
 #ifdef WIN32
 static char tmpname3[32];
 #endif
-#endif
 static int oper = OPLOAD;
 static char *editFile = NULL;
 static const char *cpp_program = NULL;
-#ifndef CPP_ARGS
-#define CPP_ARGS	NULL
-#endif
-static const char *cpp_args = CPP_ARGS;
 static const char* const cpp_locations[] = { CPP };
 static char *backup_suffix = BACKUP_SUFFIX;
 static Bool dont_execute = False;
@@ -424,7 +420,7 @@ AddDef(String *buff, char *title, char *
 #ifdef PATHETICCPP
 if (need_real_defines) {
 	addstring(buff, "\n#define ");
-	addstring(buff, title);
+	addtokstring(buff, title);
 	if (value && (value[0] != '\0')) {
 	addstring(buff, " ");
 	addstring(buff, value);
@@ -747,7 +743,7 @@ Syntax (void)
 	 " -Dname[=value], -Uname, -Idirectorypassed to preprocessor\n"
 	 "\n"
 	 "A - or no input filename represents stdin.\n",
-	 ProgramName, CPP, BACKUP_SUFFIX);
+	 ProgramName, cpp_program ? cpp_program : "", BACKUP_SUFFIX);
 exit (1);
 }
 
@@ -859,11 +855,19 @@ main(int argc, char *argv[])
 	int j;
 
 	for (j = 0; j < number_of_elements; j++) {
-	if (access(cpp_locations[j], X_OK) == 0) {
+	char *end, *dup;
+	/* cut off arguments */
+	dup = strdup(cpp_locations[j]);
+	end = strchr(dup,' ');
+	if (end)
+		*end = '\0';
+	if (access(dup, X_OK) == 0) {
 		cpp_program = cpp_locations[j];
+		free(dup);
 		break;
 	}
-	} 
+	free(dup);
+	}
 }
 
 /* needs to be replaced with XrmParseCommand */
@@ -890,10 +894,6 @@ main(int argc, char *argv[])
 		if (++i >= argc) Syntax ();
 		cpp_program = argv[i];
 		continue;
-	} else if (isabbreviation ("-cppargs", arg, 2)) {
-		if (++i >= argc) Syntax ();
-		cpp_args = argv[i];
-		continue;
 	} else if (!strcmp ("-n", arg)) {
 		dont_execute = True;
 		continue;
@@ -1238,10 +1238,7 @@ Process(int scrno, Bool doScreen, Bool e
 	fprintf(input, "\n#include \"%s\"\n", filename);
 	fclose(input);
 	(void) mktemp(tmpname3);
-	if (asprintf(&cmd, "%s%s%s -P%s %s > %s", cpp_program,
-		 cpp_args ? " " : "",
-		 cpp_args ? cpp_args : "",
-			 includes.val,
+	if (asprintf(&cmd, "%s -P%s %s > %s", cpp_program, includes.val,
 			 tmpname2, tmpname3) == -1)
 		fatal("%s: Out of memory\n", ProgramName);
 	if (system(cmd) < 0)
@@ -1256,10 +1253,7 @@ Process(int scrno, Bool doScreen, Bool e
 	fprintf(stdin, "\n#include \"%s\"\n", filename);
 	fflush(stdin);
 	fseek(stdin, 0, 0);
-	if (asprintf(&cmd, "%s%s%s -P%s", cpp_program,
-		 cpp_args ? " " : "",
-		 cpp_args ? cpp_args : "",
-			 includes.val) == -1)
+	if (asprintf(&cmd, "%s -P%s", cpp_program, includes.val) == -1)
 		fatal("%s: Out of memory\n", ProgramName);
 	if (!(input = popen(cmd, "r")))
 		fatal("%s: cannot run '%s'\n", ProgramName, cmd);
@@ -1274,9 +1268,7 @@ Process(int scrno, Bool doScreen, Bool e
 	if (cpp_program) {
 #ifdef WIN32
 	(void) mktemp(tmpname3);
-	if (asprintf(&cmd, "%s%s%s -P%s %s %s > %s", cpp_program,
-		 cpp_args ? " " : "",
-		 cpp_args ? cpp_args : "",
+	if (asprintf(&cmd, "%s -P%s %s %s > %s", cpp_program,
 			 includes.val, defines.val,
 			 filename ? filename : "", tmpname3) == -1)
 		fatal("%s: Out of memory\n", ProgramName);
@@ -1286,9 +1278,7 @@ Process(int scrno, Bool doScreen, Bool e
 	if (!(input = fopen(tmpname3, "r")))
 		fatal("%s: can't open file '%s'\n", ProgramName, tmpname3);
 #else
-	if (asprintf(&cmd, "%s%s%s -P%s %s %s", cpp_program,
-		 cpp_args ? " " : "",
-		 cpp_args ? cpp_args : "",
+	if (asprintf(&cmd, "%s -P%s %s %s", cpp_program,
 			 includes.val, defines.val,
 			 filename ? filename : "") == -1)
 		fatal("%s: Out of memory\n", ProgramName);



CVS commit: xsrc/external/mit/xrdb/dist

2011-04-05 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Apr  6 02:07:24 UTC 2011

Modified Files:
xsrc/external/mit/xrdb/dist: xrdb.c

Log Message:
merge xrdb 1.0.9


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/xrdb/dist/xrdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.4 xsrc/external/mit/xrdb/dist/xrdb.c:1.5
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.4	Mon Feb 21 04:31:22 2011
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Wed Apr  6 02:07:24 2011
@@ -146,6 +146,8 @@
 
 static void fatal(char *, ...);
 static void addstring ( String *arg, const char *s );
+static void addescapedstring ( String *arg, const char *s );
+static void addtokstring ( String *arg, const char *s );
 static void FormatEntries ( Buffer *buffer, Entries *entries );
 static void StoreProperty ( Display *dpy, Window root, Atom res_prop );
 static void Process ( int scrno, Bool doScreen, Bool execute );
@@ -437,14 +439,20 @@
 	addstring(buff, " -D");
 } else
 	addstring(buff, "-D");
-addstring(buff, title);
+addtokstring(buff, title);
 if (value && (value[0] != '\0')) {
 	addstring(buff, "=");
-	addstring(buff, value);
+	addescapedstring(buff, value);
 }
 }
 
 static void
+AddSimpleDef(String *buff, char *title)
+{
+AddDef(buff, title, (char *)NULL);
+}
+
+static void
 AddDefQ(String *buff, char *title, char *value)
 {
 #ifdef PATHETICCPP
@@ -453,8 +461,9 @@
 else
 #endif
 if (value && (value[0] != '\0')) {
-	AddDef(buff, title, "\"");
-	addstring(buff, value);
+	AddSimpleDef(buff, title);
+	addstring(buff, "=\"");
+	addescapedstring(buff, value);
 	addstring(buff, "\"");
 } else
 	AddDef(buff, title, NULL);
@@ -469,24 +478,28 @@
 }
 
 static void
-AddSimpleDef(String *buff, char *title)
+AddDefTok(String *buff, char *prefix, char *title)
 {
-AddDef(buff, title, (char *)NULL);
+char name[512];
+
+snprintf(name, sizeof(name), "%s%s", prefix, title);
+AddSimpleDef(buff, name);
 }
 
 static void
-AddDefTok(String *buff, char *prefix, char *title)
+AddDefHostname(String *buff, char *title, char *value)
 {
 char *s;
 char name[512];
 char c;
 
-snprintf(name, sizeof(name), "%s%s", prefix, title);
+strncpy (name, value, sizeof(name)-1);
+name[sizeof(name)-1] = '\0';
 for (s = name; (c = *s); s++) {
-	if (!isalpha(c) && !isdigit(c) && c != '_')
+	if (!isalpha(c) && !isdigit(c) && c != '_' && c != '.' && c != ':' && c != '-')
 	*s = '_';
 }
-AddSimpleDef(buff, name);
+AddDef(buff, title, name);
 }
 
 static void
@@ -506,7 +519,7 @@
 	addstring(buff, " -U");
 } else
 	addstring(buff, "-U");
-addstring(buff, title);
+addtokstring(buff, title);
 }
 
 static void 
@@ -569,11 +582,11 @@
 }
 if (!*server || !strcmp(server, "unix") || !strcmp(server, "localhost"))
 	strcpy(server, client);
-AddDef(defs, "HOST", server); /* R3 compatibility */
-AddDef(defs, "SERVERHOST", server);
+AddDefHostname(defs, "HOST", server); /* R3 compatibility */
+AddDefHostname(defs, "SERVERHOST", server);
 AddDefTok(defs, "SRVR_", server);
 AddNum(defs, "DISPLAY_NUM", n);
-AddDef(defs, "CLIENTHOST", client);
+AddDefHostname(defs, "CLIENTHOST", client);
 AddDefTok(defs, "CLNT_", client);
 AddNum(defs, "VERSION", ProtocolVersion(display));
 AddNum(defs, "REVISION", ProtocolRevision(display));
@@ -616,7 +629,7 @@
 AddNum(defs, "Y_RESOLUTION", Resolution(screen->height,screen->mheight));
 AddNum(defs, "PLANES", DisplayPlanes(display, scrno));
 AddNum(defs, "BITS_PER_RGB", visual->bits_per_rgb);
-AddDef(defs, "CLASS", ClassNames[visual->class]);
+AddDefQ(defs, "CLASS", ClassNames[visual->class]);
 snprintf(name, sizeof(name), "CLASS_%s", ClassNames[visual->class]);
 AddNum(defs, name, (int)visual->visualid);
 switch(visual->class) {
@@ -784,6 +797,40 @@
 arg->used += strlen(s);
 }   
 
+static void
+addescapedstring(String *arg, const char *s)
+{
+char copy[512], *c;
+
+for (c = copy; *s && c < ©[sizeof(copy)-1]; s++) {
+	switch (*s) {
+	case '"':   case '\'':  case '`':
+	case '$':   case '\\':
+	*c++ = '_';
+	break;
+	default:
+	*c++ = *s;
+	}
+}
+*c = 0;
+addstring (arg, copy);
+}
+
+static void
+addtokstring(String *arg, const char *s)
+{
+char copy[512], *c;
+
+for (c = copy; *s && c < ©[sizeof(copy)-1]; s++) {
+	if (!isalpha(*s) && !isdigit(*s) && *s != '_')
+	*c++ = '_';
+	else
+	*c++ = *s;
+}
+*c = 0;
+addstring (arg, copy);
+}
+
 
 int
 main(int argc, char *argv[])
@@ -900,7 +947,7 @@
 		continue;
 	} else if (arg[1] == 'I') {
 		addstring(&includes, " ");
-		addstring(&includes, arg);
+		addescapedstring(&includes, arg);
 		continue;
 	} else if (arg[1] == 'U' || arg[1] == 'D') {
 

CVS commit: xsrc/external/mit/xrdb/dist

2011-04-05 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Wed Apr  6 02:06:19 UTC 2011

Update of /cvsroot/xsrc/external/mit/xrdb/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv12644

Log Message:
initial import of xrdb-1.0.9.  fixes CVE-2011-0465: 

By crafting hostnames with shell escape characters, arbitrary commands
can be executed in a root environment when a display manager reads in
the resource database via xrdb.

These specially crafted hostnames can occur in two environments:

  * Hosts that set their hostname via DHCP
  * Hosts that allow remote logins via xdmcp


i will send pullups for netbsd-5, and see what netbsd-5 xfree and
netbsd-4 need as well.

Status:

Vendor Tag: xorg
Release Tags:   xrdb-1-0-9

U xsrc/external/mit/xrdb/dist/AUTHORS
U xsrc/external/mit/xrdb/dist/Makefile.am
U xsrc/external/mit/xrdb/dist/depcomp
U xsrc/external/mit/xrdb/dist/missing
U xsrc/external/mit/xrdb/dist/config.sub
U xsrc/external/mit/xrdb/dist/COPYING
U xsrc/external/mit/xrdb/dist/README
C xsrc/external/mit/xrdb/dist/xrdb.c
U xsrc/external/mit/xrdb/dist/configure.ac
U xsrc/external/mit/xrdb/dist/INSTALL
U xsrc/external/mit/xrdb/dist/config.h.in
U xsrc/external/mit/xrdb/dist/configure
U xsrc/external/mit/xrdb/dist/ChangeLog
U xsrc/external/mit/xrdb/dist/install-sh
U xsrc/external/mit/xrdb/dist/aclocal.m4
U xsrc/external/mit/xrdb/dist/Makefile.in
U xsrc/external/mit/xrdb/dist/config.guess
U xsrc/external/mit/xrdb/dist/man/Makefile.am
U xsrc/external/mit/xrdb/dist/man/xrdb.man
U xsrc/external/mit/xrdb/dist/man/Makefile.in

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jxorg:yesterday -jxorg xsrc/external/mit/xrdb/dist



CVS commit: xsrc/external/mit/xrdb/dist

2011-02-20 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Feb 21 04:31:22 UTC 2011

Modified Files:
xsrc/external/mit/xrdb/dist: xrdb.c
Removed Files:
xsrc/external/mit/xrdb/dist: xrdb.man

Log Message:
merge xrdb 1.0.8.   XXX:  this one needs to be tested carefully.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/xrdb/dist/xrdb.c
cvs rdiff -u -r1.1.1.2 -r0 xsrc/external/mit/xrdb/dist/xrdb.man

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.3 xsrc/external/mit/xrdb/dist/xrdb.c:1.4
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.3	Sat Nov 20 23:22:38 2010
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Mon Feb 21 04:31:22 2011
@@ -152,6 +152,48 @@
 static void ShuffleEntries ( Entries *db, Entries *dbs, int num );
 static void ReProcess ( int scrno, Bool doScreen );
 
+#ifndef HAVE_ASPRINTF
+/* sprintf variant found in newer libc's which allocates string to print to */
+static int _X_ATTRIBUTE_PRINTF(2,3)
+asprintf(char ** ret, const char *format, ...)
+{
+char buf[256];
+int len;
+va_list ap;
+
+va_start(ap, format);
+len = vsnprintf(buf, sizeof(buf), format, ap);
+va_end(ap);
+
+if (len < 0)
+	return -1;
+
+if (len < sizeof(buf))
+{
+	*ret = strdup(buf);
+}
+else
+{
+	*ret = malloc(len + 1); /* snprintf doesn't count trailing '\0' */
+	if (*ret != NULL)
+	{
+	va_start(ap, format);
+	len = vsnprintf(*ret, len + 1, format, ap);
+	va_end(ap);
+	if (len < 0) {
+		free(*ret);
+		*ret = NULL;
+	}
+	}
+}
+
+if (*ret == NULL)
+	return -1;
+
+return len;
+}
+#endif /* HAVE_ASPRINTF */
+
 static void 
 InitBuffer(Buffer *b)
 {
@@ -669,55 +711,30 @@
 Syntax (void)
 {
 fprintf (stderr, 
-	 "usage:  %s [-options ...] [filename]\n\n",
-	 ProgramName);
-fprintf (stderr, 
-	 "where options include:\n");
-fprintf (stderr, 
-	 " -display host:dpy   display to use\n");
-fprintf (stderr, 
-	 " -alldo all resources [default]\n");
-fprintf (stderr, 
-	 " -global do screen-independent resources\n");
-fprintf (stderr, 
-	 " -screen do screen-specific resources for one screen\n");
-fprintf (stderr, 
-	 " -screensdo screen-specific resources for all screens\n");
-fprintf (stderr,
-	 " -n  show but don't do changes\n");
-fprintf (stderr, 
-	 " -cpp filename   preprocessor to use [%s]\n",
-	 CPP);
-fprintf (stderr, 
-	 " -nocpp  do not use a preprocessor\n");
-fprintf (stderr, 
-	 " -query  query resources\n");
-fprintf (stderr,
-	 " -load   load resources from file [default]\n");
-fprintf (stderr,
-	 " -override   add in resources from file\n");
-fprintf (stderr, 
-	 " -merge  merge resources from file & sort\n");
-fprintf (stderr, 
-	 " -edit filename  edit resources into file\n");
-fprintf (stderr, 
-	 " -backup string  backup suffix for -edit [%s]\n",
-	 BACKUP_SUFFIX);
-fprintf (stderr, 
-	 " -symbolsshow preprocessor symbols\n");
-fprintf (stderr, 
-	 " -remove remove resources\n");
-fprintf (stderr, 
-	 " -retain avoid server reset (avoid using this)\n");
-fprintf (stderr,
-	 " -quiet  don't warn about duplicates\n");
-fprintf (stderr, 
-	 " -Dname[=value], -Uname, -Idirectory%s\n",
-	 "passed to preprocessor");
-fprintf (stderr, 
-	 "\n");
-fprintf (stderr,
-	 "A - or no input filename represents stdin.\n");  
+	 "usage:  %s [-options ...] [filename]\n\n"
+	 "where options include:\n"
+	 " -display host:dpy   display to use\n"
+	 " -alldo all resources [default]\n"
+	 " -global do screen-independent resources\n"
+	 " -screen do screen-specific resources for one screen\n"
+	 " -screensdo screen-specific resources for all screens\n"
+	 " -n  show but don't do changes\n"
+	 " -cpp filename   preprocessor to use [%s]\n"
+	 " -nocpp  do not use a preprocessor\n"
+	 " -query  query resources\n"
+	 " -load   load resources from file [default]\n"
+	 " -override   add in resources from file\n"
+	 " -merge  merge resources from file & sort\n"
+	 " -edit filename  edit resources into file\n"
+	 " -backup string  backup suffix for -edit [%s]\n"
+	 " -symbolsshow preprocessor symbols\n"
+	 " -remove remove resources\n"
+	 " -retain avoid server reset (avoid using this)\n"
+	 " -quiet  don't warn about duplicates\n"
+	  

CVS commit: xsrc/external/mit/xrdb/dist

2011-02-20 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Mon Feb 21 04:24:00 UTC 2011

Update of /cvsroot/xsrc/external/mit/xrdb/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv302

Log Message:
initial import of xrdb-1.0.8
- fix -nocpp
- fix interaction with gcc 4.5 cpp -P feature change

Status:

Vendor Tag: xorg
Release Tags:   xrdb-1-0-8

U xsrc/external/mit/xrdb/dist/missing
U xsrc/external/mit/xrdb/dist/aclocal.m4
U xsrc/external/mit/xrdb/dist/AUTHORS
U xsrc/external/mit/xrdb/dist/ChangeLog
U xsrc/external/mit/xrdb/dist/config.guess
U xsrc/external/mit/xrdb/dist/config.h.in
U xsrc/external/mit/xrdb/dist/config.sub
U xsrc/external/mit/xrdb/dist/configure
U xsrc/external/mit/xrdb/dist/configure.ac
U xsrc/external/mit/xrdb/dist/COPYING
U xsrc/external/mit/xrdb/dist/depcomp
U xsrc/external/mit/xrdb/dist/INSTALL
U xsrc/external/mit/xrdb/dist/install-sh
U xsrc/external/mit/xrdb/dist/Makefile.am
U xsrc/external/mit/xrdb/dist/Makefile.in
U xsrc/external/mit/xrdb/dist/README
C xsrc/external/mit/xrdb/dist/xrdb.c
N xsrc/external/mit/xrdb/dist/man/Makefile.am
N xsrc/external/mit/xrdb/dist/man/Makefile.in
N xsrc/external/mit/xrdb/dist/man/xrdb.man

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jxorg:yesterday -jxorg xsrc/external/mit/xrdb/dist



CVS commit: xsrc/external/mit/xrdb/dist

2010-11-20 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sat Nov 20 23:18:40 UTC 2010

Update of /cvsroot/xsrc/external/mit/xrdb/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv5949

Log Message:
initial import of xrdb-1.0.7

Status:

Vendor Tag: xorg
Release Tags:   xrdb-1-0-7

U xsrc/external/mit/xrdb/dist/configure.ac
U xsrc/external/mit/xrdb/dist/missing
U xsrc/external/mit/xrdb/dist/depcomp
U xsrc/external/mit/xrdb/dist/Makefile.in
U xsrc/external/mit/xrdb/dist/config.sub
U xsrc/external/mit/xrdb/dist/AUTHORS
U xsrc/external/mit/xrdb/dist/configure
U xsrc/external/mit/xrdb/dist/Makefile.am
U xsrc/external/mit/xrdb/dist/COPYING
U xsrc/external/mit/xrdb/dist/ChangeLog
U xsrc/external/mit/xrdb/dist/install-sh
U xsrc/external/mit/xrdb/dist/config.h.in
U xsrc/external/mit/xrdb/dist/aclocal.m4
U xsrc/external/mit/xrdb/dist/xrdb.man
U xsrc/external/mit/xrdb/dist/INSTALL
U xsrc/external/mit/xrdb/dist/README
U xsrc/external/mit/xrdb/dist/config.guess
C xsrc/external/mit/xrdb/dist/xrdb.c

1 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jxorg:yesterday -jxorg xsrc/external/mit/xrdb/dist



CVS commit: xsrc/external/mit/xrdb/dist

2009-12-04 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sat Dec  5 03:29:11 UTC 2009

Modified Files:
xsrc/external/mit/xrdb/dist: xrdb.c

Log Message:
- add a new -cppargs option
- default -cppargs to the CPPARGS variable if defined.
- add cppargs to the cpp command if defined.

part2 of xrdb fixes.  thanks to Patrick Welche  for
figuring out what was going wrong, and testing these changes.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 xsrc/external/mit/xrdb/dist/xrdb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xrdb/dist/xrdb.c
diff -u xsrc/external/mit/xrdb/dist/xrdb.c:1.1.1.2 xsrc/external/mit/xrdb/dist/xrdb.c:1.2
--- xsrc/external/mit/xrdb/dist/xrdb.c:1.1.1.2	Sun Nov  8 11:36:38 2009
+++ xsrc/external/mit/xrdb/dist/xrdb.c	Sat Dec  5 03:29:11 2009
@@ -130,6 +130,10 @@
 static int oper = OPLOAD;
 static char *editFile = NULL;
 static const char *cpp_program = NULL;
+#ifndef CPP_ARGS
+#define CPP_ARGS	NULL
+#endif
+static const char *cpp_args = CPP_ARGS;
 static const char* const cpp_locations[] = { CPP };
 static char *backup_suffix = BACKUP_SUFFIX;
 static Bool dont_execute = False;
@@ -808,6 +812,10 @@
 		if (++i >= argc) Syntax ();
 		cpp_program = argv[i];
 		continue;
+	} else if (isabbreviation ("-cppargs", arg, 2)) {
+		if (++i >= argc) Syntax ();
+		cpp_args = argv[i];
+		continue;
 	} else if (!strcmp ("-n", arg)) {
 		dont_execute = True;
 		continue;
@@ -1170,8 +1178,10 @@
 		   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,
-		tmpname2, tmpname3);
+	sprintf(cmd, "%s%s%s%s %s > %s", cpp_program,
+		cpp_args ? " " : "",
+		cpp_args ? cpp_args : "",
+		includes.val, tmpname2, tmpname3);
 	if (system(cmd) < 0)
 		fatal("%s: cannot run '%s'\n", ProgramName, cmd);
 	free(cmd);
@@ -1188,7 +1198,10 @@
 		malloc(strlen(cpp_program) + strlen(includes.val) + 1)) ==
 	   NULL)
 		fatal("%s: Out of memory\n", ProgramName);
-	sprintf(cmd, "%s%s", cpp_program, includes.val);
+	sprintf(cmd, "%s%s%s%s", cpp_program,
+		cpp_args ? " " : "",
+		cpp_args ? cpp_args : "",
+		includes.val);
 	if (!(input = popen(cmd, "r")))
 		fatal("%s: cannot run '%s'\n", ProgramName, cmd);
 	free(cmd);
@@ -1209,7 +1222,9 @@
 		   strlen(tmpname3) + 1)) ==
 	   NULL)
 		fatal("%s: Out of memory\n", ProgramName);
-	sprintf(cmd, "%s%s %s %s > %s", cpp_program,
+	sprintf(cmd, "%s%s%s%s %s %s > %s", cpp_program,
+		cpp_args ? " " : "",
+		cpp_args ? cpp_args : "",
 		includes.val, defines.val,
 		filename ? filename : "", tmpname3);
 	if (system(cmd) < 0)
@@ -1224,7 +1239,9 @@
 		   strlen(filename ? filename : "") + 1)) ==
 	   NULL)
 		fatal("%s: Out of memory\n", ProgramName);
-	sprintf(cmd, "%s%s %s %s", cpp_program,
+	sprintf(cmd, "%s%s%s%s %s %s", cpp_program,
+		cpp_args ? " " : "",
+		cpp_args ? cpp_args : "",
 		includes.val, defines.val,
 		filename ? filename : "");
 	if (!(input = popen(cmd, "r")))



CVS commit: xsrc/external/mit/xrdb/dist

2009-11-08 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Sun Nov  8 11:36:39 UTC 2009

Update of /cvsroot/xsrc/external/mit/xrdb/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv2612

Log Message:
initial import of xrdb-1.0.6

Status:

Vendor Tag: xorg
Release Tags:   xrdb-1-0-6

U xsrc/external/mit/xrdb/dist/configure.ac
U xsrc/external/mit/xrdb/dist/depcomp
U xsrc/external/mit/xrdb/dist/config.h.in
U xsrc/external/mit/xrdb/dist/missing
U xsrc/external/mit/xrdb/dist/xrdb.man
U xsrc/external/mit/xrdb/dist/config.sub
U xsrc/external/mit/xrdb/dist/AUTHORS
U xsrc/external/mit/xrdb/dist/COPYING
U xsrc/external/mit/xrdb/dist/Makefile.in
U xsrc/external/mit/xrdb/dist/README
U xsrc/external/mit/xrdb/dist/configure
U xsrc/external/mit/xrdb/dist/INSTALL
U xsrc/external/mit/xrdb/dist/aclocal.m4
U xsrc/external/mit/xrdb/dist/xrdb.c
U xsrc/external/mit/xrdb/dist/NEWS
U xsrc/external/mit/xrdb/dist/config.guess
U xsrc/external/mit/xrdb/dist/install-sh
U xsrc/external/mit/xrdb/dist/ChangeLog
U xsrc/external/mit/xrdb/dist/Makefile.am

No conflicts created by this import