From: <ha...@us...> - 2010-07-15 04:24:52
|
Revision: 13585 http://jmol.svn.sourceforge.net/jmol/?rev=13585&view=rev Author: hansonr Date: 2010-07-15 04:24:45 +0000 (Thu, 15 Jul 2010) Log Message: ----------- version=12.0.RC25 # new feature: "load =xxxx AS ." "." means "into the default directory; same name" Modified Paths: -------------- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java Modified: trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java =================================================================== --- trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2010-07-15 03:51:43 UTC (rev 13584) +++ trunk/Jmol/src/org/jmol/script/ScriptEvaluator.java 2010-07-15 04:24:45 UTC (rev 13585) @@ -7751,10 +7751,8 @@ int filePt = i; String localName = null; - if (tokAt(filePt + 1) == Token.as) { - localName = stringParameter(i + 2); - i += 2; - } + if (tokAt(filePt + 1) == Token.as) + localName = stringParameter(i = i + 2); if (statementLength == i + 1) { if (i == 0 || (filename = parameterAsString(filePt)).length() == 0) filename = viewer.getFullPathName(); @@ -7970,6 +7968,9 @@ if (localName != null) { if (localName.equals(".")) localName = viewer.getFilePath(filename, true); + if (localName.length() == 0 + || viewer.getFilePath(localName, false).equalsIgnoreCase(viewer.getFilePath(filename, false))) + error(ERROR_invalidArgument); String[] fullPath = new String[] { localName }; os = viewer.getOutputStream(localName, fullPath); if (os == null) @@ -15403,7 +15404,7 @@ if (tokAt(i + 1) == Token.as) i += 2; // skip that } else if (tokAt(i + 1) == Token.as) { - localName = viewer.getFilePath(stringParameter(i = i + 2), false); + localName = viewer.getFilePath(stringParameter(iToken = (i = i + 2)), false); fullPathNameOrError = viewer.getFullPathNameOrError(localName); localName = fullPathNameOrError[0]; addShapeProperty(propertyList, "localName", localName); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |