1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00

Fix user input parser, play command even not work in old variant

This commit is contained in:
Andrey A. Chernov 1996-02-01 19:09:50 +00:00
parent 67dab2c8c6
commit b8be555bd4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=13832

View File

@ -1,7 +1,7 @@
/* /*
* Compact Disc Control Utility by Serge V. Vakulenko, <vak@cronyx.ru>. * Compact Disc Control Utility by Serge V. Vakulenko, <vak@cronyx.ru>.
* Based on the non-X based CD player by Jean-Marc Zucconi and * Based on the non-X based CD player by Jean-Marc Zucconi and
* Andrew A. Chernov. * Andrey A. Chernov.
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
@ -12,7 +12,7 @@
#include <sys/cdio.h> #include <sys/cdio.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#define VERSION "1.0" #define VERSION "1.1"
/* /*
* Audio Status Codes * Audio Status Codes
@ -41,10 +41,9 @@ struct cmdtab {
#define CMD_PAUSE 5 #define CMD_PAUSE 5
{ CMD_PAUSE, "PAuse", "", }, { CMD_PAUSE, "PAuse", "", },
#define CMD_PLAY 6 #define CMD_PLAY 6
{ CMD_PLAY, "P", 0, }, { CMD_PLAY, "Play", "min1:sec1[.fr1] [min2:sec2[.fr2]]", },
{ CMD_PLAY, "Play", "min1:sec1.fr1 [ min2:sec2.fr2 ]", }, { CMD_PLAY, "Play", "track1[.index1] [track2.[index2]]", },
{ CMD_PLAY, "Play", "track1.index1 [ track2.index2 ]", }, { CMD_PLAY, "Play", "[#block [len]]", },
{ CMD_PLAY, "Play", "#block [ len ]", },
#define CMD_QUIT 7 #define CMD_QUIT 7
{ CMD_QUIT, "Quit", "", }, { CMD_QUIT, "Quit", "", },
#define CMD_RESUME 8 #define CMD_RESUME 8
@ -579,7 +578,7 @@ char *parse (char *buf, int *cmd)
continue; continue;
/* Check inambiguity. */ /* Check inambiguity. */
if (*cmd != -1) { if (*cmd != -1 && *cmd != c->command) {
fprintf (stderr, "Ambiguous command\n"); fprintf (stderr, "Ambiguous command\n");
return (0); return (0);
} }