Browse Source

Miguel Angel Alvarez writes:

Hi. I have found a bug in realpath that did not allow me to use it with
symlinks. Although I am using 0.9.28.1, the bug is present in 0.9.28 and
also in the trunk.

I attach a suggested patch. Please let me know if the solution is correct.
Eric Andersen 17 years ago
parent
commit
b48d0504bb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/stdlib/realpath.c

+ 1 - 1
libc/stdlib/realpath.c

@@ -133,7 +133,7 @@ char resolved_path[];
 				/* Make sure it's null terminated. */
 				*new_path = '\0';
 				strcpy(resolved_path, got_path);
-				return NULL;
+				return resolved_path;
 			}
 		} else {
 			/* Note: readlink doesn't add the null byte. */