summaryrefslogtreecommitdiffstats
path: root/usr.bin/rpcgen/rpc_main.c
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/rpcgen/rpc_main.c
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/rpcgen/rpc_main.c')
-rw-r--r--usr.bin/rpcgen/rpc_main.c14
1 files changed, 10 insertions, 4 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();
OpenPOWER on IntegriCloud