dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.9,1.10


From: Rhys Weatherley <address@hidden>
Subject: [Dotgnu-pnet-commits] CVS: pnet/support dir.c,1.9,1.10
Date: Sun, 15 Dec 2002 23:39:21 -0500

Update of /cvsroot/dotgnu-pnet/pnet/support
In directory subversions:/tmp/cvs-serv26603/support

Modified Files:
        dir.c 
Log Message:


ILOpenDir: append "*.*" to directories under Win32.


Index: dir.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/dir.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** dir.c       16 Dec 2002 01:32:30 -0000      1.9
--- dir.c       16 Dec 2002 04:39:19 -0000      1.10
***************
*** 318,321 ****
--- 318,323 ----
  ILDir *ILOpenDir(char *path)
  {
+       char *spec;
+       int len;
        ILDir *dir = (ILDir *)ILMalloc(sizeof(ILDir));
        if(!dir)
***************
*** 323,327 ****
                return 0;
        }
!       dir->handle = _findfirst(path, &(dir->fileinfo));
        dir->havefirst = 1;
        if(dir->handle < 0)
--- 325,342 ----
                return 0;
        }
!       spec = (char *)ILMalloc(strlen(path) + 5);
!       if(!spec)
!       {
!               ILFree(dir);
!               return 0;
!       }
!       strcpy(spec, path);
!       len = strlen(spec);
!       if(len > 0 && spec[len - 1] != '/' && spec[len - 1] != '\\')
!       {
!               spec[len++] = '\\';
!       }
!       strcpy(spec + len, "*.*");
!       dir->handle = _findfirst(spec, &(dir->fileinfo));
        dir->havefirst = 1;
        if(dir->handle < 0)
***************
*** 329,335 ****
--- 344,352 ----
                int error = errno;
                ILFree(dir);
+               ILFree(spec);
                errno = error;
                return 0;
        }
+       ILFree(spec);
        return dir;
  }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]