Skip to content

Commit 76f56bc

Browse files
Quote filenames so XeTeX handles spaces right
- This breaks all tests, because expected filenames no longer match the ones that are actually written - Spaces are handled correctly in filenames, so this fixes #36
1 parent 94237b2 commit 76f56bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tectonic/xetexini.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2865,6 +2865,8 @@ init_io(string input_file_name)
28652865
buffer[first] = 0;
28662866
k = first;
28672867

2868+
buffer[k++] = '"'; /* Quote filename so xetex accepts spaces */
2869+
28682870
while ((rval = *(ptr++)) != 0) {
28692871
UInt16 extraBytes = bytesFromUTF8[rval];
28702872

@@ -2881,7 +2883,8 @@ init_io(string input_file_name)
28812883
buffer[k++] = rval;
28822884
}
28832885

2884-
buffer[k] = ' ';
2886+
buffer[k++] = '"'; /* Quote filename so xetex accepts spaces */
2887+
buffer[k] = ' '; /* Unquoted space terminates filename for xetex engine */
28852888
last = k;
28862889
cur_input.loc = first;
28872890
cur_input.limit = last;

0 commit comments

Comments
 (0)