bug-bash
[Top][All Lists]
Advanced

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

Re: shorthand attempt at 'basename file .ext'


From: Eric Blake
Subject: Re: shorthand attempt at 'basename file .ext'
Date: Sat, 29 Mar 2008 13:20:31 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12) Gecko/20080213 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Chris F.A. Johnson on 3/29/2008 10:53 AM:
|> Also, on platforms where // is special (such as cygwin), 'basename //'
|> and 'basename // /' should print '//', not '/', to match the behavior
of the
|> basename program on those platforms.
|
|   "
|     2. If string is "//", it is implementation-defined whether steps 3
|        to 6 are skipped or processed.
|   "
|
|   I see no reference in the spec to "// /". Can you tell me where it
|   is?

If the implementation defines "//" to be a synonym for "/" (and Linux does
this), then you can choose to process steps 3-6, but process ends in step
3 where the result is "/".

If the implementation defines "//" as distinct from "/" (as is the case on
cygwin), or if you choose to preserve "//" even though it is not special,
then you skip steps 3-6, so you don't do any suffix stripping from step 6,
and the result is "//".

Either way, "basename // /" doesn't do any suffix stripping (for that
matter, NO suffix that contains / will ever participate in suffix stripping).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfuln4ACgkQ84KuGfSFAYDoVgCePGgfg0z0a9S4wzaanVYNWSYh
Cy8An3jVoxRZFZxdK+ZxJHJM4yv1Y16t
=+vTT
-----END PGP SIGNATURE-----




reply via email to

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