svn commit: trunk/uClibc/libc/stdlib

vapier at uclibc.org vapier at uclibc.org
Thu Feb 8 18:25:57 UTC 2007


Author: vapier
Date: 2007-02-08 10:25:57 -0800 (Thu, 08 Feb 2007)
New Revision: 17818

Log:
handle file_name==NULL and file_name=="" as required by POSIX

Modified:
   trunk/uClibc/libc/stdlib/realpath.c


Changeset:
Modified: trunk/uClibc/libc/stdlib/realpath.c
===================================================================
--- trunk/uClibc/libc/stdlib/realpath.c	2007-02-08 18:24:46 UTC (rev 17817)
+++ trunk/uClibc/libc/stdlib/realpath.c	2007-02-08 18:25:57 UTC (rev 17818)
@@ -58,6 +58,14 @@
 	int readlinks = 0;
 	int n;
 
+	if (path == NULL) {
+		__set_errno(EINVAL);
+		return NULL;
+	}
+	if (*path == '\0') {
+		__set_errno(ENOENT);
+		return NULL;
+	}
 	/* Make a copy of the source path since we may need to modify it. */
 	if (strlen(path) >= PATH_MAX - 2) {
 		__set_errno(ENAMETOOLONG);




More information about the uClibc-cvs mailing list