summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-25 16:53:18 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-25 16:53:18 +0200
commitf748b4760d0f8247001c0b46e9eaf02b379bc3c4 (patch)
treedd5c42aff17e47fda83f6d3faa7c6de7c9719a7c /apt-pkg/contrib
parentfd8b88d6ece1382cf3441efe721ec84d43a19bbe (diff)
* apt-pkg/contrib/cdromutl.cc:
- fix escape problem when looking for the mounted devices
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/cdromutl.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/apt-pkg/contrib/cdromutl.cc b/apt-pkg/contrib/cdromutl.cc
index 821e6d688..551efa7d9 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;
}
}
}