summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-12-23 21:33:26 +0100
committerDan McGee <dan@archlinux.org>2011-12-23 21:37:03 +0100
commitaac639351f1eb56c1f8f6f19bfe438400a02c614 (patch)
tree12a57b35ea0816d44cdff387ce186c675b1a0eec /lib/libalpm/util.c
parenta7cb1509317e929043df973a9814145fecc99513 (diff)
downloadpacman-aac639351f1eb56c1f8f6f19bfe438400a02c614.tar.gz
pacman-aac639351f1eb56c1f8f6f19bfe438400a02c614.tar.xz
Remove strtrim function from backend
The last user of this was the code in the backend for loading packages, but this no longer uses it. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 2e3f765a..fc0e0564 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -188,47 +188,6 @@ cleanup:
return ret;
}
-/** Trim leading and trailing whitespace, including newlines, from a string.
- * Modifies str in place.
- * @param str a string to trim
- * @return str
- */
-char *_alpm_strtrim(char *str)
-{
- char *pch = str;
-
- if(*str == '\0') {
- /* string is empty, so we're done. */
- return str;
- }
-
- while(isspace((unsigned char)*pch)) {
- pch++;
- }
- if(pch != str) {
- size_t len = strlen(pch);
- if(len) {
- /* move the remaining string to the beginning of str */
- memmove(str, pch, len + 1);
- } else {
- *str = '\0';
- }
- }
-
- /* check if there wasn't anything but whitespace in the string. */
- if(*str == '\0') {
- return str;
- }
-
- pch = (str + (strlen(str) - 1));
- while(isspace((unsigned char)*pch)) {
- pch--;
- }
- *++pch = '\0';
-
- return str;
-}
-
/** Trim trailing newlines from a string (if any exist).
* @param str a single line of text
* @return the length of the trimmed string