| 111 | * if it has name (to avoid binary files errors) |
| 112 | */ |
| 113 | function saveFile(): void { |
| 114 | if (currentFile !== null) { |
| 115 | if (!currentFile.oldName && possibleOldName !== null) { |
| 116 | currentFile.oldName = possibleOldName; |
| 117 | } |
| 118 | |
| 119 | if (!currentFile.newName && possibleNewName !== null) { |
| 120 | currentFile.newName = possibleNewName; |
| 121 | } |
| 122 | |
| 123 | if (currentFile.newName) { |
| 124 | files.push(currentFile); |
| 125 | currentFile = null; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | possibleOldName = null; |
| 130 | possibleNewName = null; |
| 131 | } |
| 132 | |
| 133 | /* Create file structure */ |
| 134 | function startFile(): void { |