]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
Fix a bug when install Ventoy if the USB already mounted at a path that contains...
authorlongpanda <admin@ventoy.net>
Wed, 27 Apr 2022 02:25:44 +0000 (10:25 +0800)
committerlongpanda <admin@ventoy.net>
Wed, 27 Apr 2022 02:25:44 +0000 (10:25 +0800)
15 files changed:
INSTALL/tool/aarch64/V2DServer
INSTALL/tool/aarch64/Ventoy2Disk.gtk3
INSTALL/tool/aarch64/Ventoy2Disk.qt5
INSTALL/tool/i386/V2DServer
INSTALL/tool/i386/Ventoy2Disk.gtk2
INSTALL/tool/i386/Ventoy2Disk.gtk3
INSTALL/tool/i386/Ventoy2Disk.qt5
INSTALL/tool/mips64el/V2DServer
INSTALL/tool/mips64el/Ventoy2Disk.gtk3
INSTALL/tool/mips64el/Ventoy2Disk.qt5
INSTALL/tool/x86_64/V2DServer
INSTALL/tool/x86_64/Ventoy2Disk.gtk2
INSTALL/tool/x86_64/Ventoy2Disk.gtk3
INSTALL/tool/x86_64/Ventoy2Disk.qt5
LinuxGUI/Ventoy2Disk/Core/ventoy_util.c

index 03ce6438942744699c9ac05f26cd6bc32223b48e..0cb64800e718f12645e0269553a980b2078bedb4 100644 (file)
Binary files a/INSTALL/tool/aarch64/V2DServer and b/INSTALL/tool/aarch64/V2DServer differ
index e42d6241977e4aa7d45d865fc6eaea287a3de1ad..842c524dbe2c13d79a4c2369b23b26f7aa698dc0 100644 (file)
Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 and b/INSTALL/tool/aarch64/Ventoy2Disk.gtk3 differ
index 009a1877c68f40c4735cdf1c932d2dc62df27467..0e1a49dff69baa34572fe587ded3598c32832bd0 100644 (file)
Binary files a/INSTALL/tool/aarch64/Ventoy2Disk.qt5 and b/INSTALL/tool/aarch64/Ventoy2Disk.qt5 differ
index deb103379fd412a31cb8b1e7e3e0752d58b6acf8..a3a58fccc216628927018fc58531f4c9caffcab8 100644 (file)
Binary files a/INSTALL/tool/i386/V2DServer and b/INSTALL/tool/i386/V2DServer differ
index 774f5d3267628fb5310a36c759bd82d0b9db2db5..ca248dfa9f9b0db60a61a392d7582b06205de21a 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk2 and b/INSTALL/tool/i386/Ventoy2Disk.gtk2 differ
index 6116798710c512de4f36a53702f143e9094a834b..c2c84f7f1d9f275a17d0cc0c8f6b53cc5808cb34 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.gtk3 and b/INSTALL/tool/i386/Ventoy2Disk.gtk3 differ
index b1c226d90f5f85ec84d8dd13672249ea17fe554f..1aa6f860e16483220016a6fffa0a3ca88b919b74 100644 (file)
Binary files a/INSTALL/tool/i386/Ventoy2Disk.qt5 and b/INSTALL/tool/i386/Ventoy2Disk.qt5 differ
index 38eca27ccb1495b359b4b366a420bc785c5d21b9..fdbdda5efe100e54d1208e2e358b3d252943b994 100644 (file)
Binary files a/INSTALL/tool/mips64el/V2DServer and b/INSTALL/tool/mips64el/V2DServer differ
index 83ced17043d3a081d6f894e26d8c94a5fb97c848..68b689552eb7aad69da3aece7f7fc13bf59b5ab8 100644 (file)
Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 and b/INSTALL/tool/mips64el/Ventoy2Disk.gtk3 differ
index d3c827ea38f865e0252130cf8f419048521cb7d5..4ccca4fb2ae0e6518cd98e2ecd2c78a209003a77 100644 (file)
Binary files a/INSTALL/tool/mips64el/Ventoy2Disk.qt5 and b/INSTALL/tool/mips64el/Ventoy2Disk.qt5 differ
index 0bd0a4e0acb87af04841091dfe88cd6c26e9fdd7..c5079cc2e74166fc184f17a6eac19a067e06d106 100644 (file)
Binary files a/INSTALL/tool/x86_64/V2DServer and b/INSTALL/tool/x86_64/V2DServer differ
index 20ca6b3ee73934ca9cd4f0802a31a3349ac5691b..d473a6b9522d9fdd1ed1572d7fb1050fbd06129d 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk2 differ
index 4d41ef294f0f75aee61d1aa58a4396cea0638fb2..562ecafc0d6becafb7c4853dce10b7fc33bc8347 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 and b/INSTALL/tool/x86_64/Ventoy2Disk.gtk3 differ
index 40becccf91a5e7ddcf9e5fd2ef6d272fc56573f3..df9d6aab1b9904bfbd516029375dc00b6c929534 100644 (file)
Binary files a/INSTALL/tool/x86_64/Ventoy2Disk.qt5 and b/INSTALL/tool/x86_64/Ventoy2Disk.qt5 differ
index 27c015fb0d35ae8ff11fcaaa4854bfdb0b52ae1c..cc3e5e1bf7c605e9d5872e19065967e297ee1e1f 100644 (file)
@@ -164,11 +164,40 @@ end:
     return mount;
 }
 
     return mount;
 }
 
+static int ventoy_mount_path_escape(char *src, char *dst, int len)
+{
+    int i = 0;
+    int n = 0;
+    
+    dst[len - 1] = 0;
+
+    for (i = 0; i < len - 1; i++)
+    {
+        if (src[i] == '\\' && src[i + 1] == '0' && src[i + 2] == '4' && src[i + 3] == '0')
+        {
+            dst[n++] = ' ';
+            i += 3;
+        }
+        else
+        {
+            dst[n++] = src[i];
+        }
+    
+        if (src[i] == 0)
+        {
+            break;
+        }
+    }
+
+    return 0;
+}
+
 int ventoy_try_umount_disk(const char *devpath)
 {
     int rc;
     int len;
 int ventoy_try_umount_disk(const char *devpath)
 {
     int rc;
     int len;
-    char line[512];
+    char line[1024];
+    char mntpt[1024];
     char *pos1 = NULL;
     char *pos2 = NULL;
     FILE *fp = NULL;
     char *pos1 = NULL;
     char *pos2 = NULL;
     FILE *fp = NULL;
@@ -193,14 +222,15 @@ int ventoy_try_umount_disk(const char *devpath)
                     *pos2 = 0;
                 }
 
                     *pos2 = 0;
                 }
 
-                rc = umount(pos1 + 1);
+                ventoy_mount_path_escape(pos1 + 1, mntpt, sizeof(mntpt));                
+                rc = umount(mntpt);
                 if (rc)
                 {
                 if (rc)
                 {
-                    vdebug("umount %s %s [ failed ] error:%d\n", devpath, pos1 + 1, errno);                                        
+                    vdebug("umount <%s> <%s> [ failed ] error:%d\n", devpath, mntpt, errno);                                        
                 }
                 else
                 {
                 }
                 else
                 {
-                    vdebug("umount %s %s [ success ]\n", devpath, pos1 + 1);
+                    vdebug("umount <%s> <%s> [ success ]\n", devpath, mntpt);
                 }
             }
         }
                 }
             }
         }
@@ -210,7 +240,6 @@ int ventoy_try_umount_disk(const char *devpath)
     return 0;
 }
 
     return 0;
 }
 
-
 int ventoy_read_file_to_buf(const char *FileName, int ExtLen, void **Bufer, int *BufLen)
 {
     int FileSize;
 int ventoy_read_file_to_buf(const char *FileName, int ExtLen, void **Bufer, int *BufLen)
 {
     int FileSize;