From 3e5ec1055fe8476974c268d3b81f687ef7a8bb7f Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Fri, 9 Jun 1995 02:55:07 +0000 Subject: [PATCH] Change mk_cmds so that the output file is always created in the current directory, instead of in the directory where the source file is located. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5989 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/ss/ChangeLog | 6 ++++++ src/util/ss/mk_cmds.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/util/ss/ChangeLog b/src/util/ss/ChangeLog index 1e85c2a24..e28865871 100644 --- a/src/util/ss/ChangeLog +++ b/src/util/ss/ChangeLog @@ -1,3 +1,9 @@ +Thu Jun 8 22:54:16 1995 Theodore Y. Ts'o + + * mk_cmds.c (main): Change mk_cmds so that the output file is + always created in the current directory, instead of in the + directory where the source file is located. + Thu Apr 27 12:26:26 1995 Ezra Peisach * pager.c: Use posix signals. diff --git a/src/util/ss/mk_cmds.c b/src/util/ss/mk_cmds.c index fa69b593c..0bcd77061 100644 --- a/src/util/ss/mk_cmds.c +++ b/src/util/ss/mk_cmds.c @@ -34,7 +34,7 @@ int main(argc, argv) { char c_file[MAXPATHLEN]; int result; - char *path, *p; + char *path, *p, *q; if (argc != 2) { fputs("Usage: ", stderr); @@ -61,7 +61,8 @@ int main(argc, argv) p = strrchr(path, '.'); *p = '\0'; - strcpy(c_file, path); + q = rindex(path, '/'); + strcpy(c_file, (q) ? q + 1 : path); strcat(c_file, ".c"); *p = '.'; -- 2.26.2