]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/cdromutl.cc
merged from lp:~donkult/apt/experimental
[apt.git] / apt-pkg / contrib / cdromutl.cc
index 551efa7d91a2cad6b5f2f60ee891bb77660b4ad7..9de795b60d92e25a212fa2e0bf5ac5bfac6b4d6e 100644 (file)
@@ -10,6 +10,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include<config.h>
+
 #include <apt-pkg/cdromutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/md5.h>
@@ -17,8 +19,6 @@
 #include <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 
-#include <apti18n.h>
-    
 #include <sys/wait.h>
 #include <sys/statvfs.h>
 #include <dirent.h>
@@ -26,6 +26,8 @@
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdio.h>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
 // IsMounted - Returns true if the mount point is mounted              /*{{{*/
@@ -258,13 +260,9 @@ string FindMountPointForDevice(const char *devnode)
                if(TokSplitString(' ', buf, out, 10))
                {
                   fclose(f);
-                  // unescape \040 and return the path
-                  size_t pos;
+                  // unescape the \0XXX chars in the path
                   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;
+                  return DeEscapeString(mount_point);
                }
             }
          }