1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

Handle octal escapes in /proc/self/mountinfo

This commit is contained in:
Eelco Dolstra 2012-09-28 21:39:30 -04:00
parent f406288cc7
commit e666e1156f
3 changed files with 24 additions and 2 deletions

View file

@ -1101,6 +1101,21 @@ bool endOfList(std::istream & str)
}
string decodeOctalEscaped(const string & s)
{
string r;
for (string::const_iterator i = s.begin(); i != s.end(); ) {
if (*i != '\\') { r += *i++; continue; }
unsigned char c = 0;
++i;
while (i != s.end() && *i >= '0' && *i < '8')
c = c * 8 + (*i++ - '0');
r += c;
}
return r;
}
void ignoreException()
{
try {