From 50c406be140c6cb6d0c55f1024c2b740d9e221c6 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Dec 07 2004 14:33:10 +0000 Subject: - Apply patch from bug #122699 to fix "too many includes" error. --- diff --git a/a2ps-includes.patch b/a2ps-includes.patch new file mode 100644 index 0000000..be610d0 --- /dev/null +++ b/a2ps-includes.patch @@ -0,0 +1,61 @@ +--- a2ps-4.13/src/sheets-map.l.includes 2000-02-04 21:07:47.000000000 +0000 ++++ a2ps-4.13/src/sheets-map.l 2004-09-07 16:06:27.575891868 +0100 +@@ -40,6 +40,7 @@ + + #define MAX_INCLUDE_DEPTH 10 + static YY_BUFFER_STATE include_stack[MAX_INCLUDE_DEPTH]; ++static int lineno_stack[MAX_INCLUDE_DEPTH]; + static char *filename_stack[MAX_INCLUDE_DEPTH]; + static int include_stack_ptr; + static char *yyfilename; +@@ -93,7 +94,7 @@ + white [[:space:]]+ + key [-a-zA-Z0-9_]+: + comment #.* +-include include([^)]+) ++include include\([^)]+\) + %% + + {key} token_val = xstrndup (yytext, yyleng - 1); return tKEY; +@@ -102,7 +103,7 @@ + {white} ; + {comment} ; + {include} { /* Kill the closing paren and pass the file name. */ +- yytext[yyleng] = '\0'; ++ yytext[yyleng-1] = '\0'; + yy_include_push (yytext + strlen ("include(")); + } + +@@ -210,11 +211,13 @@ + error (1, 0, _("too many includes")); + + include_stack[include_stack_ptr] = YY_CURRENT_BUFFER; +- filename_stack[include_stack_ptr++] = file; ++ lineno_stack[include_stack_ptr] = yylineno; ++ filename_stack[include_stack_ptr++] = yyfilename; + + message (msg_file, (stderr, "%s:%d: includes %s\n", + yyfilename, yylineno, file)); + ++ yyfilename = file; + yyin = xrfopen (yyfilename); + + yy_switch_to_buffer (yy_create_buffer (yyin, YY_BUF_SIZE)); +@@ -227,8 +230,8 @@ + { + fclose (yyin); + yy_delete_buffer (YY_CURRENT_BUFFER); +- free (yyfilename); + yyfilename = filename_stack[include_stack_ptr]; ++ yylineno = lineno_stack[include_stack_ptr]; + yy_switch_to_buffer (include_stack[include_stack_ptr]); + message (msg_file, (stderr, "Back to file `%s'.\n", yyfilename)); + } +@@ -254,6 +257,7 @@ + yy_close (void) + { + fclose (yyin); ++ free (yyfilename); + } + + int diff --git a/a2ps.spec b/a2ps.spec index c998efc..600583d 100644 --- a/a2ps.spec +++ b/a2ps.spec @@ -1,5 +1,5 @@ %define ver 4.13b -%define rel 41 +%define rel 42 Summary: Converts text and other types of files to PostScript(TM). Name: a2ps @@ -29,6 +29,7 @@ Patch19: a2ps-4.13-bison.patch Patch20: a2ps-4.13-hebrew.patch Patch21: a2ps-4.13-malloc.patch Patch22: a2ps-shell.patch +Patch23: a2ps-includes.patch Requires: fileutils sh-utils info BuildRequires: /usr/bin/emacs, gperf, flex, libtool, texinfo Url: http://www.inf.enst.fr/~demaille/a2ps/ @@ -87,6 +88,9 @@ and medias. # Use environment variable to pass filenames to shell (bug #128647). %patch22 -p1 -b .shell +# Apply patch from bug #122699 to fix "too many includes" error. +%patch23 -p1 -b .includes + # Fix reference to a2ps binary (bug #112930). perl -pi -e "s,/usr/local/bin,%{_bindir}," contrib/emacs/a2ps.el libtoolize --copy --force @@ -194,6 +198,9 @@ fi %dir %{_datadir}/a2ps %changelog +* Tue Dec 7 2004 Tim Waugh 4.13b-42 +- Apply patch from bug #122699 to fix "too many includes" error. + * Tue Oct 5 2004 Tim Waugh 4.13b-41 - Build requires texinfo (bug #134663).