[BusyBox] [patch] Fix deallocvt to handle no arguments

Jon McClintock jonm at bluemug.com
Thu Sep 21 21:55:25 UTC 2000


Hello,

BusyBox's deallocvt has code for handling no arguments, but the usage checking
code aborts if there are any other than two arguments. This patch fixes
that:

--- deallocvt.c.orig    Thu Sep 21 14:15:07 2000
+++ deallocvt.c Thu Sep 21 14:40:21 2000
@@ -17,7 +17,7 @@
 {
        int fd, num, i;

-       if ((argc != 2) || (**(argv + 1) == '-'))
+       if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
                usage(deallocvt_usage);

        fd = get_console_fd("/dev/console");


If you think my conditional is ugly, feel free to replace it with a pretty one.

-Jon





More information about the busybox mailing list