]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/cdromutl.cc
- add a ReadLine method
[apt.git] / apt-pkg / contrib / cdromutl.cc
index 821e6d688e45b2fd083ffea530de738dd0101dbd..187f6bd5997eb96af56a0b050137094d0d881d69 100644 (file)
@@ -10,6 +10,8 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include<config.h>
+
 #include <apt-pkg/cdromutl.h>
 #include <apt-pkg/error.h>
 #include <apt-pkg/md5.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 <apt-pkg/configuration.h>
 #include <apt-pkg/strutl.h>
 
-#include <apti18n.h>
-    
 #include <sys/wait.h>
 #include <sys/statvfs.h>
 #include <dirent.h>
 #include <sys/wait.h>
 #include <sys/statvfs.h>
 #include <dirent.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdio.h>
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdio.h>
+
+#include <apti18n.h>
                                                                        /*}}}*/
 
                                                                        /*}}}*/
 
+using std::string;
+
 // IsMounted - Returns true if the mount point is mounted              /*{{{*/
 // ---------------------------------------------------------------------
 /* This is a simple algorithm that should always work, we stat the mount point
 // IsMounted - Returns true if the mount point is mounted              /*{{{*/
 // ---------------------------------------------------------------------
 /* This is a simple algorithm that should always work, we stat the mount point
@@ -258,7 +262,9 @@ string FindMountPointForDevice(const char *devnode)
                if(TokSplitString(' ', buf, out, 10))
                {
                   fclose(f);
                if(TokSplitString(' ', buf, out, 10))
                {
                   fclose(f);
-                  return string(out[1]);
+                  // unescape the \0XXX chars in the path
+                  string mount_point = out[1];
+                  return DeEscapeString(mount_point);
                }
             }
          }
                }
             }
          }