* DJ Delorie: > diff --git a/lib/glob.c b/lib/glob.c > index 22c459574..d0521bb4a 100644 > --- a/lib/glob.c > +++ b/lib/glob.c > @@ -1381,7 +1381,26 @@ glob_in_dir (const char *pattern, const char > *directory, int flags, > if (flags & GLOB_ONLYDIR) > switch (readdir_result_type (d)) > { > - case DT_DIR: case DT_LNK: case DT_UNKNOWN: break; > + case DT_DIR: case DT_LNK: break; > + case DT_UNKNOWN: > + { > + /* The filesystem was too lazy to give us a hint, > + so we have to do it the hard way. */ > + char *fullpath, *p; > + bool isdir; > + fullpath = malloc (strlen (directory) + strlen (d.name) + > 2); > + if (fullpath == NULL) > + /* This matches old behavior wrt DT_UNKNOWN. */ > + break;
Shouldn't this report memory allocation failure to the caller? Thanks, Florian