Update of /cvsroot/winbash/winbash/lib/glob
In directory usw-pr-cvs1:/tmp/cvs-serv1614
Modified Files:
glob.c
Log Message:
In addition to defining OPENDIR_NOT_ROBUST, fix dir so that stat is happy about it not having a trailing '/'
Index: glob.c
===================================================================
RCS file: /cvsroot/winbash/winbash/lib/glob/glob.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- glob.c 11 Mar 2002 14:32:15 -0000 1.3
+++ glob.c 29 Mar 2002 17:13:00 -0000 1.4
@@ -220,6 +220,13 @@
#if defined (OPENDIR_NOT_ROBUST)
struct stat finfo;
+ int dir_len = 0;
+ if(dir) {
+ dir_len = strlen(dir);
+ if (dir[dir_len - 1] == '/')
+ dir[dir_len - 1] = '\0';
+ }
+
if (stat (dir, &finfo) < 0)
return ((char **) &glob_error_return);
|