FW: [BusyBox] Mkfifo fix
Villalovos, John L
john.l.villalovos at intel.com
Mon Jun 5 16:38:37 UTC 2000
You can also delete a file like that with:
rm ./--help
John
John Villalovos
Intel Corporation
2111 NE 25TH AVE STOP JF2-70
HILLSBORO, OR 97124-5961
(503) 264-1320 Fax: (503) 264-6380
GPG 1.+/PGP 5.+/ DSS/Diffie Helman
http://www.sodarock.com/JohnVillalovos-gpgkey.txt
1024D/1A25D86C 2F24 AD89 E5D5 C92B 7FE2 F878 7ED5 2D38 1A25 D86C
-----Original Message-----
From: Erik Andersen [mailto:andersen at lineo.com]
Sent: Saturday, June 03, 2000 10:20 PM
To: Pavel Roskin
Cc: busybox at busybox.net
Subject: Re: [BusyBox] Mkfifo fix
On Fri Jun 02, 2000 at 03:33:15PM -0400, Pavel Roskin wrote:
> Hello!
>
> Imagine this situation: you run "mkfifo --help" and it happily creates
> "--help". Then you run "rm --help" anf guess what it does? It explains you
> how to use "rm" :-)
I have added implementing 'rm -- foo' to the TODO list for 0.44.
I did something similar the other day, and had to resort to clever
use of "?" and "*" to get rid of the file, which was very annoying.
This is pretty high on my list.
> This patch checks if the name of FIFO to be created begins with "-" and
> calls usage() if it does.
>
> Regards,
> Pavel Roskin
>
> ===================================
> diff -u -r1.4 mkfifo.c
> --- mkfifo.c 2000/05/12 19:41:47 1.4
> +++ mkfifo.c 2000/06/02 19:24:28
> @@ -60,7 +60,7 @@
> argc--;
> argv++;
> }
> - if (argc < 1)
> + if (argc < 1 || *argv[0] == '-')
> usage(mkfifo_usage);
> if (mkfifo(*argv, mode) < 0) {
> perror("mkfifo");
> ===================================
Oops. Thanks, applied.
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
_______________________________________________
busybox mailing list
busybox at busybox.net
http://busybox.net/mailman/listinfo/busybox
More information about the busybox
mailing list