Skip to content

Commit 24fbfed

Browse files
committed
Fixed a bug where output file was stored in wrong location.
1 parent a80863c commit 24fbfed

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/VMTranslator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public static void main (String[] args) {
2828
if (input.isDirectory()) {
2929
Debug.println("Processing directory: " + inputFileName);
3030

31-
// isolate the directory name and append .asm (remove trailing /, if necessary)
32-
outputFileName = input.getName() + ".asm";
31+
// isolate the directory name and append .asm (remove trailing path separator, if any)
32+
outputFileName = input.getName() + ".asm"; // use the directory name as the output file name per API convention
33+
outputFileName = input.getPath() + File.separator + outputFileName; // concatenate the directory name with the output file name
3334
codewriter = new CodeWriter(outputFileName); // instantiate the CodeWriter class
3435

3536
File[] files = input.listFiles();

0 commit comments

Comments
 (0)