From adee92a6b99617337c46a77b9abd1e76613a53ae Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sun, 7 Sep 2014 17:27:50 -0400 Subject: [PATCH] Code Cleanup - Removed unused util.cpp escape function. --- src/util.cpp | 21 --------------------- src/util.h | 2 -- 2 files changed, 23 deletions(-) diff --git a/src/util.cpp b/src/util.cpp index 40d803da7..7f0a0e5e6 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -325,27 +325,6 @@ int execute ( // Collides with std::numeric_limits methods #undef max -//////////////////////////////////////////////////////////////////////////////// -// Escapes any unescaped character of type c within the given string -// e.g. ' ' -> '\ ' -const std::string escape (const std::string& value, char c) -{ - std::string modified = value; - char tmp[2] = {c, '\0'}; - std::string search = tmp; - std::string replace = "\\" + search; - - std::string::size_type pos = modified.find (search); - while (pos != std::string::npos) { - if ( modified[pos-1] != '\\' ) - modified.replace (pos, 1, replace); - - pos = modified.find (search, pos+1); - } - - return modified; -} - //////////////////////////////////////////////////////////////////////////////// // Accept a list of projects, and return an indented list // that reflects the hierarchy. diff --git a/src/util.h b/src/util.h index 1de12dc0c..b64035f60 100644 --- a/src/util.h +++ b/src/util.h @@ -61,8 +61,6 @@ int execute (const std::string&, const std::vector &, const std::st int flock (int, int); #endif -const std::string escape (const std::string&, char); - const std::vector indentTree ( const std::vector&, const std::string& whitespace = " ",