chiark / gitweb /
Prep v239: Unmask delete_chars()
authorSven Eden <yamakuzure@gmx.net>
Thu, 23 Aug 2018 06:17:24 +0000 (08:17 +0200)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
src/basic/string-util.c
src/basic/string-util.h
src/test/test-string-util.c

index 4f616db53519d03d334fda1d8220c5c6a18abd34..d7ba43541d487f8fc0fa2acf05c823908b602d09 100644 (file)
@@ -272,7 +272,6 @@ char *strstrip(char *s) {
         return delete_trailing_chars(skip_leading_chars(s, WHITESPACE), WHITESPACE);
 }
 
-#if 0 /// UNNEEDED by elogind
 char *delete_chars(char *s, const char *bad) {
         char *f, *t;
 
@@ -295,7 +294,6 @@ char *delete_chars(char *s, const char *bad) {
 
         return s;
 }
-#endif // 0
 
 char *delete_trailing_chars(char *s, const char *bad) {
         char *p, *c = s;
index 89309c2985de275623afe434f53cce411826f5d1..d3a01a65ee137006c563fba013b0311d0f923726 100644 (file)
@@ -118,9 +118,7 @@ char *strjoin_real(const char *x, ...) _sentinel_;
         })
 
 char *strstrip(char *s);
-#if 0 /// UNNEEDED by elogind
 char *delete_chars(char *s, const char *bad);
-#endif // 0
 char *delete_trailing_chars(char *s, const char *bad);
 char *truncate_nl(char *s);
 
index a9e322f0cc3adefd890d483c03c17c787e1f3bca..202af8bcc3356e327c5db1f01f8577b1b29824de 100644 (file)
@@ -384,7 +384,6 @@ static void test_endswith_no_case(void) {
         assert_se(!endswith_no_case("foobar", "FOOBARFOOFOO"));
 }
 
-#if 0 /// UNNEEDED by elogind
 static void test_delete_chars(void) {
         char *s, input[] = "   hello, waldo.   abc";
 
@@ -392,7 +391,6 @@ static void test_delete_chars(void) {
         assert_se(streq(s, "hello,waldo.abc"));
         assert_se(s == input);
 }
-#endif // 0
 
 static void test_delete_trailing_chars(void) {
 
@@ -526,9 +524,7 @@ int main(int argc, char *argv[]) {
         test_foreach_word_quoted();
         test_endswith();
         test_endswith_no_case();
-#if 0 /// UNNEEDED by elogind
         test_delete_chars();
-#endif // 0
         test_delete_trailing_chars();
         test_delete_trailing_slashes();
         test_skip_leading_chars();