Message-ID: <39A67036.8671A366@softhome.net> Date: Fri, 25 Aug 2000 15:10:14 +0200 From: Laurynas Biveinis X-Mailer: Mozilla 4.74 [en] (Win98; U) X-Accept-Language: lt,en MIME-Version: 1.0 To: DJGPP Workers Subject: __solve_dir_symlinks() tweaks Content-Type: text/plain; charset=iso-8859-4 Content-Transfer-Encoding: 7bit Reply-To: djgpp-workers AT delorie DOT com I've commited the following: Laurynas Index: sdirlink.c =================================================================== RCS file: /cvs/djgpp/djgpp/src/libc/compat/unistd/sdirlink.c,v retrieving revision 1.1 diff -u -r1.1 sdirlink.c --- sdirlink.c 2000/08/25 11:35:37 1.1 +++ sdirlink.c 2000/08/25 12:57:19 @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -10,6 +11,21 @@ { char path_copy[FILENAME_MAX]; char * last_part; + + /* Reject NULLs... */ + if (!__symlink_path || !__real_path) + { + errno = EINVAL; + return -1; + } + + /* ...and empty strings */ + if (__symlink_path[0] == '\0') + { + errno = ENOENT; + return -1; + } + strcpy(path_copy, __symlink_path); last_part = basename(path_copy); if (*last_part == '\0')