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:
parent
f406288cc7
commit
e666e1156f
3 changed files with 24 additions and 2 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue