wwivbbs/wwiv

input_path() won't accept mixed-case filenames

Closed this issue · 2 comments

some filenames have mixed-case and this makes a difference on Linux. "FILENAME" is different from "filename" and from "fileNAME". it causes some problems because in other parts of WWIV, the files created are mixed-case.

when calling the editor from WFC, i'd like to edit some files directly but input_path only accepts lower-case filenames.

e.g. wwivnet/nSUB.net or data/sSUB.net can't be edited because of this.

suggested fix:

in common/input.cpp:

@@ -358,10 +358,6 @@ void Input::Input1(char* out_text, const std::string& orig_text, int max_length,
         }
         if (mode == InputMode::FILENAME || mode == InputMode::FULL_PATH_NAME ||
             mode == InputMode::CMDLINE) {
-          if (mode == InputMode::FILENAME || mode == InputMode::FULL_PATH_NAME) {
-            // Force lowercase filenames but not command lines.
-            c = to_lower_case<unsigned char>(static_cast<unsigned char>(c));
-          }
           if (mode == InputMode::FILENAME && strchr("/\\<>|*?\";:", c)) {
             c = 0;

better fix to only affect non-WIN32 platforms:

in common/input.cpp:

@@ -358,10 +358,12 @@ void Input::Input1(char* out_text, const std::string& orig_text, int max_length,
         }
         if (mode == InputMode::FILENAME || mode == InputMode::FULL_PATH_NAME ||
             mode == InputMode::CMDLINE) {
+#ifdef _WIN32
           if (mode == InputMode::FILENAME || mode == InputMode::FULL_PATH_NAME) {
             // Force lowercase filenames but not command lines.
             c = to_lower_case<unsigned char>(static_cast<unsigned char>(c));
           }
+#endif
           if (mode == InputMode::FILENAME && strchr("/\\<>|*?\";:", c)) {
             c = 0;
           } else if (mode == InputMode::FILENAME && strchr("<>|*?\";", c)) {
wwiv commented

Nah, on windows it doesn't matter at all, I worry about on case sensitive filesystems. I'll remove it adn let's see how it goes