File: fix_symlink_to_root_dotdot

package info (click to toggle)
symlinks 1.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 156 kB
  • sloc: ansic: 1,307; makefile: 25
file content (13 lines) | stat: -rw-r--r-- 416 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
Index: symlinks/symlinks.c
===================================================================
--- symlinks.orig/symlinks.c
+++ symlinks/symlinks.c
@@ -90,7 +90,7 @@ static int tidy_path (char *path)
 
 	while ((p = strstr(path,"/../")) != NULL) {
 		s = p+3;
-		for (p--; p != path; p--) if (*p == '/') break;
+		for (p--; p > path; p--) if (*p == '/') break;
 		if (*p != '/')
 			break;
 		while ((*p++ = *s++));