From: Teiniker E. <tei...@us...> - 2007-02-05 16:49:21
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/idl In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv10643/src/ccmtools/parser/idl Modified Files: Tag: BRANCH-FHJ ParserHelper.java Log Message: Bugfix: when using cl.exe as preprocessor, path strings can contain one or two backslashes. Index: ParserHelper.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/parser/idl/ParserHelper.java,v retrieving revision 1.44 retrieving revision 1.44.4.1 diff -C2 -d -r1.44 -r1.44.4.1 *** ParserHelper.java 22 Jan 2007 13:05:13 -0000 1.44 --- ParserHelper.java 5 Feb 2007 16:49:10 -0000 1.44.4.1 *************** *** 1,4 **** --- 1,5 ---- package ccmtools.parser.idl; + import java.io.File; import java.math.BigInteger; import java.util.ArrayList; *************** *** 2290,2301 **** { setCurrentSourceLine(Integer.parseInt(elements[1])); ! String fileName = elements[2]; ! setCurrentSourceFile(fileName.substring(fileName.indexOf('\"')+1, fileName.lastIndexOf('\"'))); } } } } ! ! // #pragma public void handlePragmaLine(String line) --- 2291,2309 ---- { setCurrentSourceLine(Integer.parseInt(elements[1])); ! ! /* ! * Here we normalize pathological path strings. ! * e.g. C:\\path\\to\\file.idl => C:\path\to\file.idl ! */ ! String fileName = (new File(elements[2])).toString(); ! ! String currentSourceFile = fileName.substring(fileName.indexOf('\"')+1, fileName.lastIndexOf('\"')); ! setCurrentSourceFile(currentSourceFile); } } } } ! ! // #pragma public void handlePragmaLine(String line) |