[MPlayer-cvslog] r37507 - in branches/1.2: . gui/util/string.c gui/util/string.h

ib subversion at mplayerhq.hu
Tue Sep 8 23:02:08 CEST 2015


Author: ib
Date: Tue Sep  8 23:02:07 2015
New Revision: 37507

Log:
Merge r37490 from trunk:

Add auxiliary function ltrim().

Modified:
   branches/1.2/   (props changed)
   branches/1.2/gui/util/string.c
   branches/1.2/gui/util/string.h

Modified: branches/1.2/gui/util/string.c
==============================================================================
--- branches/1.2/gui/util/string.c	Tue Sep  8 23:02:05 2015	(r37506)
+++ branches/1.2/gui/util/string.c	Tue Sep  8 23:02:07 2015	(r37507)
@@ -100,6 +100,25 @@ char *strswap(char *in, char from, char
 }
 
 /**
+ * @brief Skip all leading space characters in a string.
+ *
+ * @param in string to be processed
+ *
+ * @return trailing part of @a in starting with the first non-space character
+ */
+const char *ltrim(const char *in)
+{
+    while (*in) {
+        if (*in == ' ')
+            in++;
+        else
+            break;
+    }
+
+    return in;
+}
+
+/**
  * @brief Remove all space characters from a string,
  *        but leave text enclosed in quotation marks untouched.
  *

Modified: branches/1.2/gui/util/string.h
==============================================================================
--- branches/1.2/gui/util/string.h	Tue Sep  8 23:02:05 2015	(r37506)
+++ branches/1.2/gui/util/string.h	Tue Sep  8 23:02:07 2015	(r37507)
@@ -36,6 +36,7 @@ char *gstrchr(const char *str, int c);
 int gstrcmp(const char *a, const char *b);
 char *gstrdup(const char *str);
 int gstrncmp(const char *a, const char *b, size_t n);
+const char *ltrim(const char *in);
 void setddup(char **old, const char *dir, const char *name);
 void setdup(char **old, const char *str);
 char *strlower(char *in);


More information about the MPlayer-cvslog mailing list