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

 
 

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

Submitter:  None
Submitted:  Thu 09 Aug 2012 11:02:20 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.82 Operating System:  MS Windows
Fixed Release:  4.0 Triage Status:  Verified
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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):


mkdir foo
mkdir foo/bar
touch foo/baz

echo '$(info $(wildcard foo/*/.))' | make -f-


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>
Group 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>
Group 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 Files:
   
   
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
  • -email is unavailable- added by psmith (Posted a comment)
  • -email is unavailable- added by eliz (Posted a comment)
  • -email is unavailable- added by log65536 (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-28 eliz StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 4.0
        Triage StatusNone Verified
    2013-04-28 psmith Triage StatusNeed Info None
    2013-04-27 eliz Triage StatusNone Need Info
    2012-08-10 log65536 Attached File- Added Makefile, #26340

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code