From: Kalle Wallin Date: Thu, 1 Jul 2004 10:52:57 +0000 (+0000) Subject: Removed the trim() function, using glib's g_strstrip() instead X-Git-Tag: v0.12_alpha1~485 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=95633d4b608f6ae3d74c6ee5c269ed2559a9966c;p=ncmpc.git Removed the trim() function, using glib's g_strstrip() instead git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1751 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- diff --git a/src/screen_play.c b/src/screen_play.c index 3478987..615472d 100644 --- a/src/screen_play.c +++ b/src/screen_play.c @@ -154,7 +154,7 @@ handle_save_playlist(screen_t *screen, mpdclient_t *c, char *name) NULL, NULL, gcmp); - filename=trim(filename); + filename=g_strstrip(filename); /* destroy completion support */ wrln_pre_completion_callback = NULL; diff --git a/src/support.c b/src/support.c index 90ecb8b..3717e6c 100644 --- a/src/support.c +++ b/src/support.c @@ -35,26 +35,6 @@ extern void screen_status_printf(char *format, ...); static gboolean noconvert = TRUE; -char * -trim(char *str) -{ - char *end; - - if( str==NULL ) - return NULL; - - while( IS_WHITESPACE(*str) ) - str++; - - end=str+strlen(str)-1; - while( end>str && IS_WHITESPACE(*end) ) - { - *end = '\0'; - end--; - } - return str; -} - char * remove_trailing_slash(char *path) { diff --git a/src/support.h b/src/support.h index fce9aac..4182d2e 100644 --- a/src/support.h +++ b/src/support.h @@ -11,7 +11,6 @@ char *basename(char *path); #define IS_WHITESPACE(c) (c==' ' || c=='\t' || c=='\r' || c=='\n') -char *trim(char *str); char *remove_trailing_slash(char *path); char *lowerstr(char *str); char *strcasestr(const char *haystack, const char *needle);