diff options
author | ache <ache@FreeBSD.org> | 1996-02-01 19:09:50 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1996-02-01 19:09:50 +0000 |
commit | 4861dbe70d6ced0849d8ff44a16e1a751e523648 (patch) | |
tree | 26aa8a439a1e7ab0d41ce36e3a072b4cb6f4b8e9 | |
parent | 44b58afd46b9e187055667ad34bb7aeddeb60859 (diff) | |
download | FreeBSD-src-4861dbe70d6ced0849d8ff44a16e1a751e523648.zip FreeBSD-src-4861dbe70d6ced0849d8ff44a16e1a751e523648.tar.gz |
Fix user input parser, play command even not work in old variant
-rw-r--r-- | usr.sbin/cdcontrol/cdcontrol.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/cdcontrol/cdcontrol.c b/usr.sbin/cdcontrol/cdcontrol.c index 95bb2d1..fcaeb97 100644 --- a/usr.sbin/cdcontrol/cdcontrol.c +++ b/usr.sbin/cdcontrol/cdcontrol.c @@ -1,7 +1,7 @@ /* * Compact Disc Control Utility by Serge V. Vakulenko, <vak@cronyx.ru>. * Based on the non-X based CD player by Jean-Marc Zucconi and - * Andrew A. Chernov. + * Andrey A. Chernov. */ #include <stdio.h> #include <stdlib.h> @@ -12,7 +12,7 @@ #include <sys/cdio.h> #include <sys/ioctl.h> -#define VERSION "1.0" +#define VERSION "1.1" /* * Audio Status Codes @@ -41,10 +41,9 @@ struct cmdtab { #define CMD_PAUSE 5 { CMD_PAUSE, "PAuse", "", }, #define CMD_PLAY 6 - { CMD_PLAY, "P", 0, }, - { CMD_PLAY, "Play", "min1:sec1.fr1 [ min2:sec2.fr2 ]", }, - { CMD_PLAY, "Play", "track1.index1 [ track2.index2 ]", }, - { CMD_PLAY, "Play", "#block [ len ]", }, + { CMD_PLAY, "Play", "min1:sec1[.fr1] [min2:sec2[.fr2]]", }, + { CMD_PLAY, "Play", "track1[.index1] [track2.[index2]]", }, + { CMD_PLAY, "Play", "[#block [len]]", }, #define CMD_QUIT 7 { CMD_QUIT, "Quit", "", }, #define CMD_RESUME 8 @@ -579,7 +578,7 @@ char *parse (char *buf, int *cmd) continue; /* Check inambiguity. */ - if (*cmd != -1) { + if (*cmd != -1 && *cmd != c->command) { fprintf (stderr, "Ambiguous command\n"); return (0); } |