diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2017-08-18T10·01+0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-18T10·01+0200 |
commit | e56e79064212f58a5ce775f75b6c91f05721043a (patch) | |
tree | c0a7797bba12e237ed5643c066fe50b51b357872 | |
parent | e2f9a61dc95f8f0ee51995ad88f4c5d5bd0e7740 (diff) | |
parent | 6bb4e3e8fe30a09d174a04295ba074ee006ebb4f (diff) |
Merge pull request #1525 from wingo/remove-buggy-octal-decoder
Remove unused decodeOctalEscaped
-rw-r--r-- | src/libutil/util.cc | 15 | ||||
-rw-r--r-- | src/libutil/util.hh | 6 |
2 files changed, 0 insertions, 21 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 55d3e1d16f6c..c2bceea3d9d0 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -1140,21 +1140,6 @@ std::string toLower(const std::string & s) } -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 { diff --git a/src/libutil/util.hh b/src/libutil/util.hh index 35909c8d5b31..7340ca6c7478 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -349,12 +349,6 @@ bool hasSuffix(const string & s, const string & suffix); std::string toLower(const std::string & s); -/* Escape a string that contains octal-encoded escape codes such as - used in /etc/fstab and /proc/mounts (e.g. "foo\040bar" decodes to - "foo bar"). */ -string decodeOctalEscaped(const string & s); - - /* Exception handling in destructors: print an error message, then ignore the exception. */ void ignoreException(); |