]> granicus.if.org Git - sudo/commitdiff
took out unneeded code by changing where a strings was terminated
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 8 Jun 1994 16:56:37 +0000 (16:56 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 8 Jun 1994 16:56:37 +0000 (16:56 +0000)
realpath.c
sudo_realpath.c

index 97b6f461e9d4d9f307c3af2aa5716736616cb6e2..6854b42265249c62028616aa7c83f2452b647063 100644 (file)
@@ -164,14 +164,8 @@ char * realpath(old, new)
        return(realpath_ret(NULL, cwd));
     }
 
-    *(temp++) = '\0';
-    (void) strcpy(buf, temp);
-
-    /* if the last '/' is the first char in new we need to preserve it */
-    if (new[0] == '\0') {
-       new[0] = '/';
-       new[1] = '\0';
-    }
+    (void) strcpy(buf, ++temp);
+    *temp = '\0';
 
     /*
      * chdir() to new and go a getcwd() to find real path then
index 97b6f461e9d4d9f307c3af2aa5716736616cb6e2..6854b42265249c62028616aa7c83f2452b647063 100644 (file)
@@ -164,14 +164,8 @@ char * realpath(old, new)
        return(realpath_ret(NULL, cwd));
     }
 
-    *(temp++) = '\0';
-    (void) strcpy(buf, temp);
-
-    /* if the last '/' is the first char in new we need to preserve it */
-    if (new[0] == '\0') {
-       new[0] = '/';
-       new[1] = '\0';
-    }
+    (void) strcpy(buf, ++temp);
+    *temp = '\0';
 
     /*
      * chdir() to new and go a getcwd() to find real path then