about summary refs log tree commit diff
path: root/src/libutil/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/util.cc')
-rw-r--r--src/libutil/util.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index 7f95d398147f..afb0dc0b2c07 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -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 {