void-packages/srcpkgs/cuetools/patches/unicode.diff
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

41 lines
1,016 B
Diff

--- a/src/lib/cue_scan.l
+++ b/src/lib/cue_scan.l
@@ -18,6 +18,20 @@ int cue_lineno = 1;
ws [ \t\r]
nonws [^ \t\r\n]
+
+ASC [\x00-\x7f]
+ASCN [\x00-\b]
+ASCNN [\v-\x1f]
+ASCNNN [\x21-\x7f]
+U [\x80-\xbf]
+U2 [\xc2-\xdf]
+U3 [\xe0-\xef]
+U4 [\xf0-\xf4]
+
+UANY {ASC}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+UANYN {ASCN}|{ASCNN}|{ASCNNN}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+UWS {ws}|{U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U}
+
%option noyywrap
%option prefix="cue_yy"
@@ -32,7 +46,7 @@ nonws [^ \t\r\n]
return STRING;
}
-<NAME>{nonws}+ {
+<NAME>{UANYN}+ {
yylval.sval = strdup(yytext);
BEGIN(INITIAL);
return STRING;
@@ -84,7 +98,7 @@ SIZE_INFO { BEGIN(NAME); yylval.ival = PTI_SIZE_INFO; return SIZE_INFO; }
ISRC { BEGIN(NAME); return TRACK_ISRC; }
-^{ws}*REM.*\n { cue_lineno++; /* ignore comments */ }
+^{UWS}*REM.*\n { cue_lineno++; /* ignore comments */ }
{ws}+ { /* ignore whitespace */ }
[[:digit:]]+ { yylval.ival = atoi(yytext); return NUMBER; }