bugmake - Bugs: bug #37065, $(wildcard dir/*/.) is wrong...

 
 

bug #37065: $(wildcard dir/*/.) is wrong (worked fine in 3.81)

Submitted by:  None
Submitted on:  Thu 09 Aug 2012 11:02:20 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.82Operating System: MS Windows
Fixed Release: 4.0Triage Status: Verified

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 28 Apr 2013 06:09:12 PM UTC, comment #5:

Sorry, I missed the attached makefile.

This bug is now solved (commit 5667376). It was caused by a change in string_glob: in 3.81 it tested whether each file name returned by 'glob' actually existed, and discarded non-existent ones. Make 3.82 no longer does that, and this exposed a bug in MS-Windows 'stat' which assigns no special meaning to a file name that ends in "/."; it normalizes it, which removes the period and the slash, and returns information about a file without making sure it is a directory.

I solved this by using the local_stat wrapper on MS-Windows, which we arrange to be called from 'glob'. It now detects this special case and verifies that the parent directory exists and is a directory. We just need to remember never to remove the GLOB_ALTDIRFUNC flag from the call to 'glob' ;-)

Eli Zaretskii <eliz>
Project Member
Sun 28 Apr 2013 05:56:12 AM UTC, comment #4:

Hi Eli; there's a makefile attached. It's maybe not everything we'd wish for in a repro case but it seems to be enough to try. Something like this (but translated to Windows):

should show just "foo/bar/." Rossen appears to be saying that on Windows, this will show "foo/bar/. foo/baz/." which is clearly not correct. I'm resetting the triage status: if this example doesn't work for you please update again. Cheers!

Paul D. Smith <psmith>
Project Administrator
Fri 10 Aug 2012 06:31:14 AM UTC, comment #3:

Could you please show a short Makefile to reproduce the problem?

Thanks.

Eli Zaretskii <eliz>
Project Member
Thu 09 Aug 2012 11:17:02 PM UTC, comment #2:

Sorry, again. This time I think I got it:
$(wildcard dir/*/.) matches non-directories for the `*'.

Rossen Mikhov <log65536>
Thu 09 Aug 2012 11:12:27 PM UTC, comment #1:

Sorry, I messed up the markup.
I meant that +$(wildcard dir//.)+ matches non-directories for the `++'.

Rossen Mikhov <log65536>
Thu 09 Aug 2012 11:02:20 PM UTC, original submission:

$(wildcard dir//.) matches non-directories for the `' (returns dir/somefile.txt/. as well as dir/subdir/.) in 3.82 (and latest CVS) on Windows.

This was a convenient way to get a list of sub-directories of a given directory. It used to work fine in 3.81 on Windows, and still does in 3.82 on other platforms.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26340:  Makefile added by log65536 (31B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by eliz (Posted a comment)
  • -unavailable- added by log65536 (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 28 Apr 2013 06:09:12 PM UTCelizStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0
      Triage StatusNone=>Verified
    Sun 28 Apr 2013 05:56:12 AM UTCpsmithTriage StatusNeed Info=>None
    Sat 27 Apr 2013 05:14:01 PM UTCelizTriage StatusNone=>Need Info
    Fri 10 Aug 2012 07:44:33 AM UTClog65536Attached File-=>Added Makefile, #26340

    Back to the top


    Powered by Savane 3.1-cleanup