diff --git a/ChangeLog b/ChangeLog index 38eda1c8f..2ab83f76e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-11-04 Robert Larice + * src/misc/string.c , + * src/misc/stringutil.h : + minor modification of strtolower(), and implement strtoupper() + 2010-11-04 Robert Larice * src/frontend/plotting/x11.c : minor rewrite, fix a minor bug in the x11 zoom-in function diff --git a/src/misc/string.c b/src/misc/string.c index e6d075d78..da33d2519 100644 --- a/src/misc/string.c +++ b/src/misc/string.c @@ -132,10 +132,22 @@ void strtolower(char *str) { if (str) - while (*str) { - *str = tolower(*str); - str++; - } + while (*str) { + if(isupper(*str)) + *str = (char) tolower(*str); + str++; + } +} + +void +strtoupper(char *str) +{ + if (str) + while (*str) { + if(islower(*str)) + *str = (char) toupper(*str); + str++; + } } #ifdef CIDER diff --git a/src/misc/stringutil.h b/src/misc/stringutil.h index 932b43236..e53b9644b 100644 --- a/src/misc/stringutil.h +++ b/src/misc/stringutil.h @@ -18,6 +18,7 @@ int scannum(char *str); int cieq(register char *p, register char *s); int ciprefix(register char *p, register char *s); void strtolower(char *str); +void strtoupper(char *str); char * stripWhiteSpacesInsideParens(char *str); char * gettok(char **s); char * gettok_instance(char **);