diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-25 16:53:18 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-25 16:53:18 +0200 |
commit | f748b4760d0f8247001c0b46e9eaf02b379bc3c4 (patch) | |
tree | dd5c42aff17e47fda83f6d3faa7c6de7c9719a7c /apt-pkg/contrib/cdromutl.cc | |
parent | fd8b88d6ece1382cf3441efe721ec84d43a19bbe (diff) | |
download | apt-f748b4760d0f8247001c0b46e9eaf02b379bc3c4.tar.gz |
* apt-pkg/contrib/cdromutl.cc:
- fix escape problem when looking for the mounted devices
Diffstat (limited to 'apt-pkg/contrib/cdromutl.cc')
-rw-r--r-- | apt-pkg/contrib/cdromutl.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc index 821e6d68..551efa7d 100644 --- a/apt-pkg/contrib/cdromutl.cc +++ b/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; } } } |