From fc66fff2620d46f75dce0b4901cc15902bf91c8e Mon Sep 17 00:00:00 2001 From: Olly Betts Date: Tue, 5 Jun 2007 17:48:16 +0000 Subject: [PATCH] Fix reporting of filenames in errors after %include (patch from Leigh Smith in #1731040; also reported as #1699940). git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9847 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- CHANGES.current | 4 ++++ Source/CParse/parser.y | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES.current b/CHANGES.current index e0e51c73e..ef07de537 100644 --- a/CHANGES.current +++ b/CHANGES.current @@ -1,6 +1,10 @@ Version 1.3.32 (in progress) ============================ +06/05/2007: olly + Fix reporting of filenames in errors after %include (patch from + Leigh Smith in #1731040; also reported as #1699940). + 05/31/2007: olly [Python] Fix "missing initialiser" warning when compiling generated C/C++ diff --git a/Source/CParse/parser.y b/Source/CParse/parser.y index d01828dd2..161d8b4ca 100644 --- a/Source/CParse/parser.y +++ b/Source/CParse/parser.y @@ -1360,7 +1360,7 @@ static void tag_nodes(Node *n, const String_or_char *attrname, DOH *value) { } dtype; struct { char *type; - char *filename; + String *filename; int line; } loc; struct { @@ -1863,9 +1863,9 @@ fragment_directive: FRAGMENT LPAREN fname COMMA kwargs RPAREN HBLOCK { ------------------------------------------------------------ */ include_directive: includetype options string LBRACKET { - $1.filename = Swig_copy_string(cparse_file); + $1.filename = Copy(cparse_file); $1.line = cparse_line; - scanner_set_location($3,1); + scanner_set_location(NewString($3),1); } interface RBRACKET { String *mname = 0; $$ = $6;