Menu

#30 [patch] Stop to replace some special characters in file name for cygwin.

Unstable (example)
open
nobody
None
5
2024-04-24
2022-06-17
No

Currently, cygwin allows to use some special characters such as ':', '<', '>', '|', '"', '?' and '*'in file name. Therefore, replacing them with '_' in unzip is not necessary anymore.

--- origsrc/unzip60/unix/unix.c 2022-06-16 23:53:07.294144300 +0900
+++ src/unzip60/unix/unix.c 2022-06-17 00:01:05.388706800 +0900
@@ -578,14 +578,7 @@ int mapname(__G__ renamed)
                 break;

 #ifdef __CYGWIN__   /* Cygwin runs on Win32, apply FAT/NTFS filename rules */
-            case ':':         /* drive spec not stored, so no colon allowed */
             case '\\':        /* '\\' may come as normal filename char (not */
-            case '<':         /*  dir sep char!) from unix-like file system */
-            case '>':         /* no redirection symbols allowed either */
-            case '|':         /* no pipe signs allowed */
-            case '"':         /* no double quotes allowed */
-            case '?':         /* no wildcards allowed */
-            case '*':
                 *pp++ = '_';  /* these rules apply equally to FAT and NTFS */
                 break;
 #endif

Discussion

  • Takashi Yano

    Takashi Yano - 2022-06-17

    Sorry, the comment is broken with above patch...

     
  • Sam Tansy

    Sam Tansy - 2024-04-22

    How do you want to create such files in windows?

     
  • Takashi Yano

    Takashi Yano - 2024-04-24

    Cygwin replaces these chars with unicode chars of 0xf000 | ch. Therefore, cygwin can treat these chars as a part of filename. Of course, they cannot be displayed properly outside cygwin.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.