[PATCH] bug in coreutils/unlink.c

Denys Vlasenko vda.linux at googlemail.com
Mon Jun 23 11:20:06 UTC 2014


On Mon, Jun 23, 2014 at 12:10 PM, Xabier Oneca  --  xOneca
<xoneca at gmail.com> wrote:
>> be studying further the matter files starting with a dash
>> could be successfully removed with bb's and original unlink with:
>>
>> echo > -test
>> unlink -- -test
>>
>> so eventually the patch could be dropped.
>>
>> Ciao,
>> Tito
>
> You could also use /absolute/-paths or ./-relative-paths. But '--' is
> used to separate options from arguments (in applications that support
> it, e.g. those which use getopt), so the "canonical" way is using
> double-dashes.

Yes, because of scripting. Think about this:

unlink -- "$FILENAME"   # works for any name
unlink "./$FILENAME"   # fails for absolute names
unlink "$PWD/$FILENAME"   # ditto


More information about the busybox mailing list