bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] file name with backslash is not archived


From: Eric Blake
Subject: Re: [Bug-tar] file name with backslash is not archived
Date: Tue, 02 Nov 2010 14:18:13 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat/3.1.3-1.el6 Mnenhy/0.8.3 Thunderbird/3.1.3

On 11/02/2010 02:13 PM, Paul Eggert wrote:
> +AT_TAR_CHECK([
> +mkdir src dest
> +
> +for odd_name in '!' '"' '#' '$' '%' '&' "'" '(' ')' '*' '+' ',' '-' \
> +  '...' ':' ';' '<' '=' '>' '?' '@' '[' '\0' '\\' '\n' '\r' '\' ']' '^' _ \
> +  '`' '{' '|' '}' 'http:ouch' ; do
> +  # Don't worry if the file cannot be created due to an oddball file system.
> +  touch src/"$odd_name" 2>/dev/null

This won't work in cygwin - there, \ and / are synonymous for directory
separators, and 'touch src/\' will successfully touch the directory src.
 To correctly rule out cygwin, you need to try touching a longer
pattern, as in:

touch src/a"$odd_name"a

such that the touch will fail on cygwin (directory src/a does not exist,
so we can't create src/a\a aka. src/a/a) and correctly be skipped for
this test.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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