Code

Removed the trim() function, using glib's g_strstrip() instead
authorKalle Wallin <kaw@linux.se>
Thu, 1 Jul 2004 10:52:57 +0000 (10:52 +0000)
committerKalle Wallin <kaw@linux.se>
Thu, 1 Jul 2004 10:52:57 +0000 (10:52 +0000)
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@1751 09075e82-0dd4-0310-85a5-a0d7c8717e4f

src/screen_play.c
src/support.c
src/support.h

index 3478987b55e848da6eea6c92140ff00fcf8405ed..615472dccf644b3511a1164b1fb5984783da7ed2 100644 (file)
@@ -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;
index 90ecb8b0d444a5b11df1395887b36521952f81ec..3717e6c0f4a0c8137978cf82fe584a9d453e8f4c 100644 (file)
@@ -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)
 {
index fce9aac28b68782c3a058ce86322bbcc44fe73cc..4182d2e746dddd3326b458dd6f6b95ec697a5d94 100644 (file)
@@ -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);