util/StringUtil: add StripRight() overload with "end" argument

This commit is contained in:
Max Kellermann
2014-08-07 15:15:56 +02:00
parent 5c5c6a965c
commit 59d38f876a
6 changed files with 50 additions and 18 deletions

View File

@@ -40,7 +40,6 @@
#endif
#ifdef USE_XDG
#include "util/CharUtil.hxx"
#include "util/StringUtil.hxx"
#include "TextFile.hxx"
#include <string.h>
@@ -169,9 +168,7 @@ ParseConfigLine(char *line, const char *dir_name, AllocatedPath &result_dir)
if (line_end == nullptr)
return true;
} else {
line_end = line + strlen(line);
while (line < line_end && IsWhitespaceNotNull(line_end[-1]))
--line_end;
line_end = StripRight(line, line + strlen(line));
}
// check for empty result