=> 04cec8bb69f5afc2883235aa8fd0a329671279be
[1mdiff --git a/src/gmrequest.c b/src/gmrequest.c[m [1mindex 1a7c37df..3dd92eec 100644[m [1m--- a/src/gmrequest.c[m [1m+++ b/src/gmrequest.c[m [36m@@ -597,16 +597,18 @@[m [mvoid submit_GmRequest(iGmRequest *d) {[m else if (equalCase_Rangecc(url.scheme, "file")) {[m /* TODO: Move handling of "file://" URLs elsewhere, it's getting complex. */[m iString *path = collect_String(localFilePathFromUrl_String(&d->url));[m [32m+[m[32m /* Note: As a local file path, `path` uses the OS directory separators[m [32m+[m[32m (i.e., \ on Windows). `Archive` accepts both. */[m iFile *f = new_File(path);[m if (isDirectory_(path)) {[m [31m- if (endsWith_String(path, "/")) {[m [32m+[m[32m if (endsWith_String(path, iPathSeparator)) {[m removeEnd_String(path, 1);[m }[m resp->statusCode = success_GmStatusCode;[m setCStr_String(&resp->meta, "text/gemini");[m iString *page = collectNew_String();[m iString *parentDir = collectNewRange_String(dirName_Path(path));[m [31m- appendFormat_String(page, "=> %s " upArrow_Icon " %s/\n\n",[m [32m+[m[32m appendFormat_String(page, "=> %s " upArrow_Icon " %s" iPathSeparator "\n\n",[m cstrCollect_String(makeFileUrl_String(parentDir)),[m cstr_String(parentDir));[m appendFormat_String(page, "# %s\n", cstr_Rangecc(baseName_Path(path)));[m [36m@@ -630,7 +632,7 @@[m [mvoid submit_GmRequest(iGmRequest *d) {[m appendFormat_String(page, "=> %s %s%s\n",[m cstrCollect_String(makeFileUrl_String(path_FileInfo(entry))),[m cstr_Rangecc(baseName_Path(path_FileInfo(entry))),[m [31m- isDirectory_FileInfo(entry) ? "/" : "");[m [32m+[m[32m isDirectory_FileInfo(entry) ? iPathSeparator : "");[m iRelease(entry);[m }[m set_Block(&resp->body, utf8_String(page));[m [36m@@ -652,7 +654,8 @@[m [mvoid submit_GmRequest(iGmRequest *d) {[m iString *entryPath = collect_String(copy_String(path));[m remove_Block(&entryPath->chars, 0, size_String(container) + 1); /* last slash, too */[m iBool isDir = isDirectory_Archive(arch, entryPath);[m [31m- if (isDir && !isEmpty_String(entryPath) && !endsWith_String(entryPath, "/")) {[m [32m+[m[32m if (isDir && !isEmpty_String(entryPath) &&[m [32m+[m[32m !endsWith_String(entryPath, iPathSeparator)) {[m /* Must have a slash for directories, otherwise relative navigation[m will not work. */[m resp->statusCode = redirectPermanent_GmStatusCode;[m [36m@@ -683,7 +686,9 @@[m [mvoid submit_GmRequest(iGmRequest *d) {[m const iRangecc parentDir = dirName_Path(collectNewRange_String(curDir));[m if (!equal_Rangecc(parentDir, ".")) {[m /* A subdirectory. */[m [31m- appendFormat_String(page, "=> ../ " upArrow_Icon " %s/\n",[m [32m+[m[32m appendFormat_String(page,[m [32m+[m[32m "=> ../ " upArrow_Icon " %s" iPathSeparator[m [32m+[m[32m "\n",[m cstr_Rangecc(parentDir));[m }[m else {[m [1mdiff --git a/src/gmutil.c b/src/gmutil.c[m [1mindex 2a4f4728..718a0a9a 100644[m [1m--- a/src/gmutil.c[m [1m+++ b/src/gmutil.c[m [36m@@ -439,6 +439,7 @@[m [miString *localFilePathFromUrl_String(const iString *d) {[m if (startsWith_String(path, "/")) {[m remove_Block(&path->chars, 0, 1);[m }[m [32m+[m[32m replace_Block(&path->chars, '/', '\\');[m #endif[m return path;[m }[m
text/gemini; charset=utf-8
This content has been proxied by September (ba2dc).