[Top][All Lists]

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

Re: Infinite loop in globbing

From: Micah Cowan
Subject: Re: Infinite loop in globbing
Date: Mon, 14 Mar 2011 10:30:48 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20101208 Thunderbird/3.1.7

On 03/14/2011 10:06 AM, Chet Ramey wrote:
>> On 03/14/2011 07:55 AM, Chet Ramey wrote:
>>> The question is how to best handle it: punt immediately, or just treat it
>>> as a single-byte character and move on.
>> I vote single-byte character; after all, it's possible for a filename to
>> contain that character, regardless of what your locale may be.
> Oh, it does do that.  I meant in the context of attempting to convert the
> entire string to a wide-char string.  If the wide-char string conversion
> fails, the globbing engine treats it as a sequence of single bytes.  There
> are efficiency improvements that can be made there, though.

Yeah. But if we treat it as a single char and move on, we can at least
"correctly" treat any further, legal character sequences. Not that
anyone should have any particular expectations once they include an
invalid character, if the further characters aren't in the same encoding
as the actual filename...

Micah J. Cowan

reply via email to

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