Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/usr.bin/cdplay Pull up revision 1.21 (requested by is i...



details:   https://anonhg.NetBSD.org/src/rev/5998d400ac4a
branches:  netbsd-1-6
changeset: 529160:5998d400ac4a
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Oct 13 23:38:54 2002 +0000

description:
Pull up revision 1.21 (requested by is in ticket #872):
0 is a valid value for the absolute minute to stop playing. Initialize
to UINT_MAX before scanning, and check for UINT_MAX to detect whether it
was set.
Without this, it is not possible to play the first less than a minute of
a CD using absolute msf addresses.

diffstat:

 usr.bin/cdplay/cdplay.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (44 lines):

diff -r cd1f0145c9b3 -r 5998d400ac4a usr.bin/cdplay/cdplay.c
--- a/usr.bin/cdplay/cdplay.c   Sun Oct 13 23:31:01 2002 +0000
+++ b/usr.bin/cdplay/cdplay.c   Sun Oct 13 23:38:54 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cdplay.c,v 1.19 2002/01/23 01:09:15 thorpej Exp $      */
+/*     $NetBSD: cdplay.c,v 1.19.2.1 2002/10/13 23:38:54 lukem Exp $    */
 
 /*
  * Copyright (c) 1999, 2000, 2001 Andrew Doran.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: cdplay.c,v 1.19 2002/01/23 01:09:15 thorpej Exp $");
+__RCSID("$NetBSD: cdplay.c,v 1.19.2.1 2002/10/13 23:38:54 lukem Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -54,6 +54,7 @@
 #include <err.h>
 #include <errno.h>
 #include <histedit.h>
+#include <limits.h>
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -672,6 +673,8 @@
                return (play_msf(m1, s1, f1, m2, s2, f2));
 
 Try_Absolute_Timed_Addresses:
+               m2 = UINT_MAX;
+
                if (6 != sscanf(arg, "%d:%d.%d%d:%d.%d",
                        &m1, &s1, &f1, &m2, &s2, &f2) &&
                    5 != sscanf(arg, "%d:%d.%d%d:%d", &m1, &s1, &f1, &m2, &s2) &&
@@ -681,7 +684,7 @@
                    2 != sscanf(arg, "%d:%d", &m1, &s1))
                        goto Clean_up;
 
-               if (m2 == 0) {
+               if (m2 == UINT_MAX) {
                        if (msf) {
                                m2 = toc_buffer[n].addr.msf.minute;
                                s2 = toc_buffer[n].addr.msf.second;



Home | Main Index | Thread Index | Old Index