diff options
author | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
---|---|---|
committer | Pixel <pixel@nobis-crew.org> | 2010-06-15 00:59:57 -0700 |
commit | eed0eb6a476d54ce19aeff137984aa981d9e3976 (patch) | |
tree | 807891636efd2f87dcbd261e971216269973ae07 /iup/src/iup_str.c | |
parent | ccc8261e4d48de89da4ddfe7b55e378ae0cd6f47 (diff) |
Upgrading to iup 3.1
Diffstat (limited to 'iup/src/iup_str.c')
-rwxr-xr-x | iup/src/iup_str.c | 24 |
1 files changed, 13 insertions, 11 deletions
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) |