From eed0eb6a476d54ce19aeff137984aa981d9e3976 Mon Sep 17 00:00:00 2001 From: Pixel Date: Tue, 15 Jun 2010 00:59:57 -0700 Subject: Upgrading to iup 3.1 --- iup/src/iup_str.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'iup/src/iup_str.c') diff --git a/iup/src/iup_str.c b/iup/src/iup_str.c index 68976f1..5f5b85d 100755 --- a/iup/src/iup_str.c +++ b/iup/src/iup_str.c @@ -147,8 +147,9 @@ char *iupStrCopyUntil(char **str, int c) return NULL; p_str=strchr(*str,c); - if (!p_str) return NULL; - + if (!p_str) + return NULL; + else { int i; int sl=(int)(p_str - (*str)); @@ -160,10 +161,10 @@ char *iupStrCopyUntil(char **str, int c) new_str[i] = (*str)[i]; new_str[sl] = 0; - } - *str = p_str+1; - return new_str; + *str = p_str+1; + return new_str; + } } char *iupStrCopyUntilNoCase(char **str, int c) @@ -174,11 +175,12 @@ char *iupStrCopyUntilNoCase(char **str, int c) p_str=strchr(*str,c); /* usually the lower case is enough */ if (!p_str && isalpha(c)) - { p_str=strchr(*str, toupper(c)); /* but check also for upper case */ - if (!p_str) return NULL; - } + /* if both fail, then abort */ + if (!p_str) + return NULL; + else { int i; int sl=(int)(p_str - (*str)); @@ -190,10 +192,10 @@ char *iupStrCopyUntilNoCase(char **str, int c) new_str[i] = (*str)[i]; new_str[sl] = 0; - } - *str = p_str+1; - return new_str; + *str = p_str+1; + return new_str; + } } char *iupStrGetMemory(int size) -- cgit v1.2.3