libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [4/11] Native MSVC support (file-magic-glob)


From: Peter Rosin
Subject: Re: [4/11] Native MSVC support (file-magic-glob)
Date: Tue, 17 Jul 2007 10:49:54 +0200
User-agent: Mutt/1.5.12-2006-07-14

On Fri, Jul 13, 2007 at 05:25:59PM +0200, Paolo Bonzini wrote:
> 
> >>s/[A-Za-z]/*|&|ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ*/g
> >>s/\*|\(.\)|[A-Za-z]*\1[A-Za-z]\{25\}\([A-Za-z]\)[A-Za-z]*\*/[\1\2]/g
> >
> >Ah, that's a nice solution. I was considering the following:
> 
> This is inspired me the following in turn, which is faster than my 
> ultra-compact version and also uses little pattern space.  I haven't 
> benchmarked it against yours:
> 
> y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
> h
> y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/
> G
> s/^/\n/
> :f
> s/\n\([A-Za-z]\)\(.*\)\(\n\)\(.\)/[\1\4]\3\2\3/
> s/\n\([^A-Za-z]\)\(.*\)\(\n\)./\1\3\2\3/
> /\n\n$/!bf
> s///

Well, I did some benchmarking, and my original program is fastest
of the four in my trials.

But, it made me think... If the shell supports "shopt -s nocaseglob",
which bash does, that can be used instead of the sed script.

So, I updated the patch and added a test to check for regressions.
The test fails on cygwin and mingw w/o this patch.

I think the test will also fail on cygwin with managed mount, this
should probably be detected and the test should be skipped if run
on a managed mount just as it is skipped on non-(cygwin|mingw).

        * libltdl/m4/libtool.m4 (_LT_CHECK_MAGIC_METHOD),
        libltdl/config/ltmain.m4sh (func_mode_link): On Windows,
        find potential libs regardless of file name case.
        * tests/nocase.at: New test, to check for regressions
        of the above.
        * Makefile.am: Add above new test.

Cheers,
Peter

Attachment: file-magic-glob.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]