summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authornate <nate@FreeBSD.org>1995-03-04 17:47:50 +0000
committernate <nate@FreeBSD.org>1995-03-04 17:47:50 +0000
commit44a74d9438343e917536adbb0ef1d2da66f7f761 (patch)
treecaec78e1a2976eebf966419ead9c6d6a06a1c172 /usr.bin
parent112ef6e028be002eaa5f27ebaaadfa7faccabadd (diff)
downloadFreeBSD-src-44a74d9438343e917536adbb0ef1d2da66f7f761.zip
FreeBSD-src-44a74d9438343e917536adbb0ef1d2da66f7f761.tar.gz
Fix rpcgen so that generated files are written to the current working
directory (instead of the same directory as the source files) and that #includes in those files do not contain the path to the source file. Obtained from: J.T. Conklin via NetBSD
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rpcgen/rpc_main.c14
-rw-r--r--usr.bin/rpcgen/rpc_svcout.c6
2 files changed, 13 insertions, 7 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
index 981c94d..4d84aab 100644
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)rpc_main.c 1.7 87/06/24 (C) 1987 SMI";*/
-static char rcsid[] = "$Id: rpc_main.c,v 1.1 1993/09/13 23:20:15 jtc Exp $";
+static char rcsid[] = "$Id: rpc_main.c,v 1.1 1994/08/07 18:01:31 wollman Exp $";
#endif
/*
@@ -109,16 +109,22 @@ main(argc, argv)
}
/*
- * add extension to filename
+ * strip path and add extension to filename
*/
static char *
-extendfile(file, ext)
- char *file;
+extendfile(path, ext)
+ char *path;
char *ext;
{
+ char *file;
char *res;
char *p;
+ if ((file = rindex(path, '/')) == NULL)
+ file = path;
+ else
+ file++;
+
res = alloc(strlen(file) + strlen(ext) + 1);
if (res == NULL) {
abort();
diff --git a/usr.bin/rpcgen/rpc_svcout.c b/usr.bin/rpcgen/rpc_svcout.c
index 7f375c5..15c91a7 100644
--- a/usr.bin/rpcgen/rpc_svcout.c
+++ b/usr.bin/rpcgen/rpc_svcout.c
@@ -29,7 +29,7 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)rpc_svcout.c 1.6 87/06/24 (C) 1987 SMI";*/
-static char rcsid[] = "$Id: rpc_svcout.c,v 1.1 1993/09/13 23:20:19 jtc Exp $";
+static char rcsid[] = "$Id: rpc_svcout.c,v 1.1 1994/08/07 18:01:36 wollman Exp $";
#endif
/*
@@ -222,7 +222,7 @@ write_program(def, storage)
f_print(fout, "\t}\n");
f_print(fout, "\tbzero((char *)&%s, sizeof(%s));\n", ARG, ARG);
- printif("getargs", TRANSP, "&", ARG);
+ printif("getargs", TRANSP, "(caddr_t)&", ARG);
printerr("decode", TRANSP);
f_print(fout, "\t\treturn;\n");
f_print(fout, "\t}\n");
@@ -235,7 +235,7 @@ write_program(def, storage)
printerr("systemerr", TRANSP);
f_print(fout, "\t}\n");
- printif("freeargs", TRANSP, "&", ARG);
+ printif("freeargs", TRANSP, "(caddr_t)&", ARG);
f_print(fout, "\t\t(void)fprintf(stderr, \"unable to free arguments\\n\");\n");
f_print(fout, "\t\texit(1);\n");
f_print(fout, "\t}\n");
OpenPOWER on IntegriCloud