[BusyBox] Mkfifo fix
Erik Andersen
andersen at lineo.com
Sun Jun 4 05:20:27 UTC 2000
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--
More information about the busybox
mailing list