Change mk_cmds so that the output file is always created in the
authorTheodore Tso <tytso@mit.edu>
Fri, 9 Jun 1995 02:55:07 +0000 (02:55 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 9 Jun 1995 02:55:07 +0000 (02:55 +0000)
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
src/util/ss/mk_cmds.c

index 1e85c2a246ce5883c8750c28687e7136049fdfdb..e28865871816ef0ab88f6ec748fad11c90ab5a9c 100644 (file)
@@ -1,3 +1,9 @@
+Thu Jun  8 22:54:16 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * 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  <epeisach@kangaroo.mit.edu>
 
        * pager.c: Use posix signals.
index fa69b593c6053df2b5547a9e9f55d495d6a5c884..0bcd77061a3382b5de855b96655a0e7aee015829 100644 (file)
@@ -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 = '.';