Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=f3b370618c59cd80201c64f2c4dca75aab61eecc

commit f3b370618c59cd80201c64f2c4dca75aab61eecc
Author: Michel Hermier <[email protected]>
Date:   Fri Nov 29 13:21:46 2013 +0100

libpacman: Make f_strtoupper of _pacman_strtoupper.

diff --git a/lib/libpacman/fstring.c b/lib/libpacman/fstring.c
index 035a313..37927d1 100644
--- a/lib/libpacman/fstring.c
+++ b/lib/libpacman/fstring.c
@@ -27,6 +27,19 @@

#include "fstdlib.h"

+/* Convert a string to uppercase
+ */
+char *f_strtoupper(char *str)
+{
+       char *ptr = str;
+
+       while(*ptr) {
+               (*ptr) = toupper(*ptr);
+               ptr++;
+       }
+       return str;
+}
+
/* Trim whitespace and newlines from a string
*/
char *f_strtrim(char *str)
diff --git a/lib/libpacman/fstring.h b/lib/libpacman/fstring.h
index ed897b5..fc7a906 100644
--- a/lib/libpacman/fstring.h
+++ b/lib/libpacman/fstring.h
@@ -23,6 +23,7 @@

#include <string.h>

+#define _pacman_strtoupper f_strtoupper
#define _pacman_strtrim f_strtrim

static inline
@@ -37,6 +38,7 @@ size_t f_strlen(const char *s)
return s != NULL ? strlen(s) : 0;
}

+char *f_strtoupper(char *str);
char *f_strtrim(char *str);

#endif /* _F_STRING_H */
diff --git a/lib/libpacman/util.h b/lib/libpacman/util.h
index d2ca11f..1fdf15d 100644
--- a/lib/libpacman/util.h
+++ b/lib/libpacman/util.h
@@ -65,7 +65,6 @@
char *_pacman_basename(const char *path);
int _pacman_makepath(char *path);
int _pacman_copyfile(char *src, char *dest);
-char *_pacman_strtoupper(char *str);
int _pacman_lckmk(char *file);
int _pacman_lckrm(char *file);
int _pacman_unpack(const char *archive, const char *prefix, const char *fn);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to