From: Ray R. <ray...@gm...> - 2011-04-25 20:06:41
|
I have multiple latex files in several directories which means I need to use the commandline -cp [path] to find the parent SECTION files. I think there is a bug where the file being processes is in the local directory. The current code fails to set the czt.path if the file argument file.getParent() == null. This happens when the given file argument has no associated path information. So ./spec.tex is ok, /a/b/c/spec.tex is ok but just spec.tex tickles the bug which results in the -cp argument being ignored. e.g., java -jar czt.jar -cp ../sections spec.tex // fails as the -cp arg is ignored and the czt.path is not set. However, java -jar czt.jar -cp ../sections ./spec.tex // works ok with current code. The fix is adjusting an if's bracing so the czt.path is always set if the variable cztpath is some parsed value from the arguments. SVN DIFF is below from a updated repository copy. Thanks for all your hard work on CZT. Ray Index: ui/src/main/java/net/sourceforge/czt/ui/Main.java =================================================================== --- ui/src/main/java/net/sourceforge/czt/ui/Main.java (revision 7414) +++ ui/src/main/java/net/sourceforge/czt/ui/Main.java (working copy) @@ -223,11 +223,10 @@ cztpath = ((cztpath == null || cztpath.isEmpty()) ? fileParent : (oldcztpath.isEmpty() ? (fileParent + File.pathSeparator + cztpath) : (fileParent + File.pathSeparator + oldcztpath + File.pathSeparator + cztpath))); - if (cztpath != null && !cztpath.trim().isEmpty()) - { + } + if (cztpath != null && !cztpath.trim().isEmpty()) { manager.setProperty("czt.path", cztpath); } - } boolean parsed = parse(source, manager, syntaxCheckOnly, prove, domainCheck); if (parsed && output != null) { String dcOutput = getDCFilename(output); -- The object of life is not to be on the side of the majority, but to escape finding oneself in the ranks of the insane. - Marcus Aurelius |