FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 12-23-2011, 07:40 PM
Dan McGee
 
Default 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>
---
lib/libalpm/util.c | 41 -----------------------------------------
lib/libalpm/util.h | 1 -
2 files changed, 0 insertions(+), 42 deletions(-)

diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 2e3f765..fc0e056 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 == '') {
- /* 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 = '';
- }
- }
-
- /* check if there wasn't anything but whitespace in the string. */
- if(*str == '') {
- return str;
- }
-
- pch = (str + (strlen(str) - 1));
- while(isspace((unsigned char)*pch)) {
- pch--;
- }
- *++pch = '';
-
- 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
diff --git a/lib/libalpm/util.h b/lib/libalpm/util.h
index 54e69c1..6d5c0c3 100644
--- a/lib/libalpm/util.h
+++ b/lib/libalpm/util.h
@@ -113,7 +113,6 @@ enum _alpm_csum {
int _alpm_makepath(const char *path);
int _alpm_makepath_mode(const char *path, mode_t mode);
int _alpm_copyfile(const char *src, const char *dest);
-char *_alpm_strtrim(char *str);
size_t _alpm_strip_newline(char *str);

int _alpm_open_archive(alpm_handle_t *handle, const char *path,
--
1.7.8.1
 

Thread Tools




All times are GMT. The time now is 06:16 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org