Просмотр исходного кода

* apt-pkg/contrib/cdromutl.cc:
- fix escape problem when looking for the mounted devices

Michael Vogt лет назад: 15
Родитель
Сommit
f748b4760d
2 измененных файлов с 9 добавлено и 1 удалено
  1. 7 1
      apt-pkg/contrib/cdromutl.cc
  2. 2 0
      debian/changelog

+ 7 - 1
apt-pkg/contrib/cdromutl.cc

@@ -258,7 +258,13 @@ string FindMountPointForDevice(const char *devnode)
                if(TokSplitString(' ', buf, out, 10))
                {
                   fclose(f);
-                  return string(out[1]);
+                  // unescape \040 and return the path
+                  size_t pos;
+                  string mount_point = out[1];
+                  static const char *needle = "\\040";
+                  while ((pos = mount_point.find(needle)) != string::npos)
+                     mount_point.replace(pos, strlen(needle), " ");
+                  return mount_point;
                }
             }
          }

+ 2 - 0
debian/changelog

@@ -4,6 +4,8 @@ apt (0.8.15.2) unstable; urgency=high
     code (LP: #784473)
   * cmdline/apt-get.cc:
     - fix missing download progress in apt-get download
+  * apt-pkg/contrib/cdromutl.cc:
+    - fix escape problem when looking for the mounted devices
 
  -- Michael Vogt <mvo@debian.org>  Tue, 12 Jul 2011 11:54:47 +0200