On Sun, Jan 25, 2026 at 05:13:09PM +0000, Gavin Smith wrote:
> On Sat, Jan 17, 2026 at 05:50:44PM +0100, [email protected] wrote:
> > On Sat, Jan 17, 2026 at 01:43:52PM +0200, Eli Zaretskii wrote:
> > > What is 'glob' used for?
> > 
> >   xasprintf (&glob_format, "%s/*.cnf", cnf_dir);
> > 
> >   glob_status = glob (glob_format, 0, 0, &possible_files);
> > 
> > >  Perhaps it would be possible to write native
> > > Windows code to achieve the same, since Windows APIs for finding files
> > > by their wildcards do exist.  As long as the code doesn't need any
> > > 'glob'-specific features and doesn't use Unix-style wildcards like
> > > "*.[ch]", replacing it with Windows native code shouldn't be
> > > difficult.
> > 
> > Given that the use is basic, it should be possible.  But I think that
> > using the Gnulib version is the least demanding in term of code, need
> > for specific testing, which is why it has my favor.
> 
> Here's a patch to use opendir/readdir instead.  I don't think it is
> much harder to understand than the code using glob.  (I have tested it,
> although there is always a chance there is a bug in my code.)

Looks good to me.  I agree that it is quite straightforward.

-- 
Pat

  • Re: ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
    • ... Eli Zaretskii
      • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
        • ... Eli Zaretskii
    • ... Patrice Dumas
      • ... Gavin Smith
        • ... Gavin Smith
          • ... Eli Zaretskii
            • ... pertusus
              • ... Gavin Smith
              • ... pertusus
          • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
            • ... Gavin Smith
              • ... Patrice Dumas
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Gavin Smith
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Gavin Smith
              • ... Bruno Haible via Bug reports for the GNU Texinfo documentation system
              • ... Gavin Smith
              • ... Patrice Dumas

Reply via email to