rse 98/04/05 23:16:49
Modified: src/test/rename/csubst Makefile csubst.c lexer.c lexer.l
util.c
Added: src/test/rename/csubst util.h
Log:
Make the csubst program more portable, so Roy can use
it at least under Solaris, too.
Revision Changes Path
1.2 +0 -1 apache-1.3/src/test/rename/csubst/Makefile
Index: Makefile
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/rename/csubst/Makefile,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Makefile 1998/04/03 06:20:14 1.1
+++ Makefile 1998/04/06 06:16:44 1.2
@@ -26,7 +26,6 @@
-rm -f $(PROG) *.o
distclean: clean
- -rm -f Makefile
realclean: distclean
-rm -f lexer.c
1.2 +2 -1 apache-1.3/src/test/rename/csubst/csubst.c
Index: csubst.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/rename/csubst/csubst.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- csubst.c 1998/04/03 06:20:14 1.1
+++ csubst.c 1998/04/06 06:16:44 1.2
@@ -3,7 +3,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <err.h>
+
+#include "util.h"
#include "tokens.h"
1.2 +2 -2 apache-1.3/src/test/rename/csubst/lexer.c
Index: lexer.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/rename/csubst/lexer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lexer.c 1998/04/03 06:20:15 1.1
+++ lexer.c 1998/04/06 06:16:45 1.2
@@ -1,7 +1,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
- * $Header: /export/home/cvs/apache-1.3/src/test/rename/csubst/lexer.c,v 1.1
1998/04/03 06:20:15 rse Exp $
+ * $Header: /export/home/cvs/apache-1.3/src/test/rename/csubst/lexer.c,v 1.2
1998/04/06 06:16:45 rse Exp $
*/
#define FLEX_SCANNER
@@ -534,8 +534,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <err.h>
+#include "util.h"
#include "tokens.h"
extern int opt_directives;
1.2 +1 -1 apache-1.3/src/test/rename/csubst/lexer.l
Index: lexer.l
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/rename/csubst/lexer.l,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- lexer.l 1998/04/03 06:20:15 1.1
+++ lexer.l 1998/04/06 06:16:45 1.2
@@ -10,8 +10,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <err.h>
+#include "util.h"
#include "tokens.h"
extern int opt_directives;
1.2 +6 -8 apache-1.3/src/test/rename/csubst/util.c
Index: util.c
===================================================================
RCS file: /export/home/cvs/apache-1.3/src/test/rename/csubst/util.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- util.c 1998/04/03 06:20:16 1.1
+++ util.c 1998/04/06 06:16:45 1.2
@@ -6,8 +6,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <err.h>
+#include "util.h"
+
/*
* Return an allocated memory area.
*/
@@ -47,9 +48,6 @@
*/
-/* The name of the running program. */
-extern char *__progname;
-
void
err(int status, const char *fmt, ...)
{
@@ -65,7 +63,7 @@
{
int olderrno = errno;
- fprintf(stderr, "%s: ", __progname);
+ fprintf(stderr, "csubst: ");
if (fmt != NULL) {
vfprintf(stderr, fmt, ap);
fprintf(stderr, ": ");
@@ -88,7 +86,7 @@
void
verrx(int status, const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", __progname);
+ fprintf(stderr, "csubst: ");
if (fmt != NULL)
vfprintf(stderr, fmt, ap);
fputc('\n', stderr);
@@ -111,7 +109,7 @@
{
int olderrno = errno;
- fprintf(stderr, "%s: ", __progname);
+ fprintf(stderr, "csubst: ");
if (fmt != NULL) {
vfprintf(stderr, fmt, ap);
fprintf(stderr, ": ");
@@ -132,7 +130,7 @@
void
vwarnx(const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", __progname);
+ fprintf(stderr, "csubst: ");
if (fmt != NULL)
vfprintf(stderr, fmt, ap);
fputc('\n', stderr);
1.1 apache-1.3/src/test/rename/csubst/util.h
Index: util.h
===================================================================
#include <stdarg.h>
extern void err(int status, const char *fmt, ...);
extern void verr(int status, const char *fmt, va_list ap);
extern void errx(int status, const char *fmt, ...);
extern void verrx(int status, const char *fmt, va_list ap);
extern void warn(const char *fmt, ...);
extern void vwarn(const char *fmt, va_list ap);
extern void warnx(const char *fmt, ...);
extern void vwarnx(const char *fmt, va_list ap);