shithub: cuefs

Download patch

ref: fff686c2f47cc41c09328e9f5bffe5b4a1037281
parent: 0b3f9e8300f084a030c21db509c1b31cfcc29ab5
author: Tevo <estevan.cps@gmail.com>
date: Fri Nov 20 18:29:10 EST 2020

Tiny fixes

--- a/cue.c	Fri Nov 20 13:24:23 2020
+++ b/cue.c	Fri Nov 20 18:29:10 2020
@@ -113,7 +113,7 @@
 	if(c->entries == nil)
 		c->entries = new;
 	else
-		c->curentry->next = nil;
+		c->curentry->next = new;
 
 	c->curentry = new;
 }
--- a/cue.l	Fri Nov 20 13:24:23 2020
+++ b/cue.l	Fri Nov 20 18:29:10 2020
@@ -47,5 +47,5 @@
 [:\n]			return *yytext;
 
 "REM".*\n		;
-[ \t]+			;
+[ \t\r]+		;
 %%
--- a/cue.y	Fri Nov 20 13:24:23 2020
+++ b/cue.y	Fri Nov 20 18:29:10 2020
@@ -3,13 +3,21 @@
 #include <libc.h>
 
 #include "cuefs.h"
+
+/*
+ * FIXME find a way to "fix" the grammar so that it
+ * doesn't do right-hand recursion (and overflow the
+ * stack) instead of just growing it and pretending
+ * it's not a problem
+ */
+#define YYMAXDEPTH 8192
 %}
 
 %union
 {
-	int i;
-	char *str;
 	Timestamp time;
+	char *str;
+	int i;
 }
 
 %token <i>   INTEGER
--- a/cuefs.h	Fri Nov 20 13:24:23 2020
+++ b/cuefs.h	Fri Nov 20 18:29:10 2020
@@ -45,10 +45,9 @@
 typedef struct Entry
 {
 	Timestamps;
-	int index;
 	AFile *file;
+	int index;
 	char *title, *performer;
-	Timestamp start;
 	struct Entry *next;
 } Entry;
 
--- a/mkfile	Fri Nov 20 13:24:23 2020
+++ b/mkfile	Fri Nov 20 18:29:10 2020
@@ -6,6 +6,9 @@
 YFILES=\
 	cue.y
 
+HDR=\
+	cuefs.h
+
 OBJ=\
 	lex.yy.$O	\
 	y.tab.$O	\
@@ -14,8 +17,10 @@
 	cue.$O		\
 	fs.$O
 
-%.$O: %.c
-	$CC $CFLAGS $prereq
+CFLAGS=$CFLAGS
+
+%.$O: %.c $HDR
+	$CC $CFLAGS $stem.c
 
 $O.out: $OBJ
 	$LD $prereq
@@ -23,7 +28,7 @@
 lex.yy.c: $LFILES y.tab.h
 	$LEX -9 $LFILES
 
-y.tab.c y.tab.h: $YFILES
+y.tab.c y.tab.h: $YFILES mkfile
 	$YACC -d $YFILES
 
 clean nuke:V: