about summary refs log tree commit diff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-21 19:12:55 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2020-03-25 23:49:02 +0000
commitdabfd1f1fbab2b6543f541488c73bdc28230f43f (patch)
tree85c858892f32985950feba628c60d130f3dd0bb8 /Src/utils.c
parent12347c26ce2041e9c06abb0a42d1fa759c4a0551 (diff)
downloadzsh-dabfd1f1fbab2b6543f541488c73bdc28230f43f.tar.gz
zsh-dabfd1f1fbab2b6543f541488c73bdc28230f43f.tar.xz
zsh-dabfd1f1fbab2b6543f541488c73bdc28230f43f.zip
45583/0007: Remove code that is now unreachable.
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/Src/utils.c b/Src/utils.c
index df2ab11a6..98dac6780 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -919,18 +919,16 @@ slashsplit(char *s)
     return r;
 }
 
-/* expands symlinks and .. or . expressions
+/* expands .. or . expressions and one level of symlinks
  *
  * Puts the result in the global "xbuf"
  *
- * If "full" is true, resolve one level of symlinks only.
- *
  * WARNING: This will segfault on symlink loops (thread: workers/45282)
  */
 
 /**/
 static int
-xsymlinks(char *s, int full)
+xsymlinks(char *s)
 {
     char **pp, **opp;
     char xbuf2[PATH_MAX*3+1], xbuf3[PATH_MAX*2+1];
@@ -979,7 +977,7 @@ xsymlinks(char *s, int full)
 	} else {
 	    ret = 1;
 	    metafy(xbuf3, t0, META_NOALLOC);
-	    if (!full) {
+	    {
 		/*
 		 * If only one expansion requested, ensure the
 		 * full path is in xbuf.
@@ -1014,17 +1012,6 @@ xsymlinks(char *s, int full)
 		 */
 		break;
 	    }
-	    if (*xbuf3 == '/') {
-		strcpy(xbuf, "");
-		if (xsymlinks(xbuf3 + 1, 1) < 0)
-		    ret = -1;
-		else
-		    xbuflen = strlen(xbuf);
-	    } else
-		if (xsymlinks(xbuf3, 1) < 0)
-		    ret = -1;
-		else
-		    xbuflen = strlen(xbuf);
 	}
     }
     freearray(opp);
@@ -1062,7 +1049,7 @@ print_if_link(char *s, int all)
 	    char xbuflink[PATH_MAX+1];
 	    *xbuf = '\0';
 	    for (;;) {
-		if (xsymlinks(start, 0) > 0) {
+		if (xsymlinks(start) > 0) {
 		    printf(" -> ");
 		    zputs(*xbuf ? xbuf : "/", stdout);
 		    if (!*xbuf)