From 1b318330c94a19b922d05b6fac19f6a4a59d248a Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 12 Jan 2023 22:35:09 -0500 Subject: [2.0] minor windows path-related fixes, windows installer version --- .gitignore | 1 + lsp-write.c | 2 +- lsp.c | 6 ------ util.c | 7 ++++--- windows_installer/ted/ted/ted.vdproj | 6 +++--- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index c770116..e16f559 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ TAGS pcre2* SDL2 *.deb +.vs test.txt log.txt UpgradeLog.htm diff --git a/lsp-write.c b/lsp-write.c index 4409593..79c1dd9 100644 --- a/lsp-write.c +++ b/lsp-write.c @@ -192,7 +192,7 @@ static void write_file_uri(JSONWriter *o, LSPDocumentID document) { for (const char *p = path; *p; ++p) { char c = *p; #if _WIN32 - // i think file URIs have to use slashes? + // file URIs use slashes: https://en.wikipedia.org/wiki/File_URI_scheme if (c == '\\') c = '/'; #endif diff --git a/lsp.c b/lsp.c index a23e7e8..9617f6d 100644 --- a/lsp.c +++ b/lsp.c @@ -482,12 +482,6 @@ u32 lsp_document_id(LSP *lsp, const char *path) { *value = id; LSPDocumentData *data = arr_addp(lsp->document_data); data->path = str_dup(path); - #if _WIN32 - // file URIs use slashes: https://en.wikipedia.org/wiki/File_URI_scheme - for (char *p = data->path; *p; ++p) - if (*p == '\\') - *p = '/'; - #endif } u32 id = *value; SDL_UnlockMutex(lsp->document_mutex); diff --git a/util.c b/util.c index e40f258..a0e91aa 100644 --- a/util.c +++ b/util.c @@ -338,9 +338,10 @@ void qsort_with_context(void *base, size_t nmemb, size_t size, #endif const char *path_filename(const char *path) { - const char *last_path_sep = strrchr(path, PATH_SEPARATOR); - if (last_path_sep) - return last_path_sep + 1; + for (int i = (int)strlen(path) - 1; i >= 0; --i) { + if (strchr(ALL_PATH_SEPARATORS, path[i])) + return &path[i+1]; + } // (a relative path with no path separators) return path; } diff --git a/windows_installer/ted/ted/ted.vdproj b/windows_installer/ted/ted/ted.vdproj index 6c990cd..909fc20 100644 --- a/windows_installer/ted/ted/ted.vdproj +++ b/windows_installer/ted/ted/ted.vdproj @@ -505,15 +505,15 @@ { "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:ted" - "ProductCode" = "8:{2B6331CC-DB09-4CFC-819F-6D8D7707915B}" - "PackageCode" = "8:{D84EA5BF-43A5-4D0C-88B6-B5AC0A4704B5}" + "ProductCode" = "8:{D7D35954-7468-44BA-A191-C4BA78CF956D}" + "PackageCode" = "8:{D8DF04B8-B84A-47EB-B6CB-539C31D6BFC6}" "UpgradeCode" = "8:{844F6C2B-DF3B-4A81-9BD5-603401BBA651}" "AspNetVersion" = "8:2.0.50727.0" "RestartWWWService" = "11:FALSE" "RemovePreviousVersions" = "11:TRUE" "DetectNewerInstalledVersion" = "11:FALSE" "InstallAllUsers" = "11:FALSE" - "ProductVersion" = "8:22.12.0721" + "ProductVersion" = "8:23.01.1224" "Manufacturer" = "8:ted" "ARPHELPTELEPHONE" = "8:" "ARPHELPLINK" = "8:" -- cgit v1.2.3