Mail Archives: djgpp-workers/1996/11/05/10:00:00
On Mon, 4 Nov 1996, Robert Hoehne wrote:
> The glob function (and probably also some other function) still
> do not handle correct filenames, which start with a dot
> (which are possible in Win 95 with LFN enabled). For checking
> it do a
>
> touch .gdbint
>
> and then a
>
> ls .gdb*
>
> and the file is not found.
Yep, it's a bug in `glob' (has been there since v2.0, as far as I could
see). It assumed that any filename which begins with a dot is either "."
or ".." and ignored them, but this isn't true anymore on LFN platforms.
With the patch below, "ls .gdb*" now finds `.gdbinit'.
DJ, I have uploaded file- text- and sh-utils linked against the library
with all the latest patches to your /incoming. Sh-utils got a minor
improvement ("test -x prog" will now also find prog.exe, prog.com etc.),
so I've uploaded the source distribution also.
*** src/libc/posix/glob/glob.c~0 Tue Nov 5 13:53:50 1996
--- src/libc/posix/glob/glob.c Tue Nov 5 14:20:14 1996
*************** glob_dirs(const char *rest, char *epathb
*** 105,111 ****
{
char short_name[13];
! if ((ff.ff_name[0] != '.') && (ff.ff_attrib & FA_DIREC))
{
int i;
char *tp;
--- 105,112 ----
{
char short_name[13];
! if ((ff.ff_attrib & FA_DIREC)
! && (strcmp(ff.ff_name, ".") && strcmp(ff.ff_name, "..")))
{
int i;
char *tp;
*************** glob2(const char *pattern, char *epathbu
*** 287,293 ****
{
int i;
char fshort[13];
! if (ff.ff_name[0] != '.')
{
/* Long filenames are never lower-cased! */
if (lower
--- 288,295 ----
{
int i;
char fshort[13];
! if ((ff.ff_attrib & FA_DIREC) == 0
! || (strcmp(ff.ff_name, ".") && strcmp(ff.ff_name, "..")))
{
/* Long filenames are never lower-cased! */
if (lower
- Raw text -