cvs: php4 /ext/standard/ string.c
[email protected] ("Hartmut Holzgraefe") Thu, 01 Jun 2000 09:56:54 -0000
| Newsgroups | php.version4 |
|---|---|
| Message-ID | <cvshholzgra959853414@cvsserver> |
hholzgra Thu Jun 1 02:56:54 2000 EDT
Modified files:
/php4/ext/standard string.c
Log:
ucwords will now test against isspace() instead of just ==" "
(see BUG #4748)
Index: php4/ext/standard/string.c
diff -u php4/ext/standard/string.c:1.115 php4/ext/standard/string.c:1.116
--- php4/ext/standard/string.c:1.115 Tue May 23 13:16:14 2000
+++ php4/ext/standard/string.c Thu Jun 1 02:56:54 2000
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: string.c,v 1.115 2000/05/23 20:16:14 rasmus Exp $ */
+/* $Id: string.c,v 1.116 2000/06/01 09:56:54 hholzgra Exp $ */
/* Synced with php 3.0 revision 1.193 1999-06-16 [ssb] */
@@ -1155,12 +1155,14 @@
r=return_value->value.str.val;
r_end = r + (*str)->value.str.len;
- while((r=php_memnstr(r, " ", 1, r_end)) != NULL){
- if(r < r_end){
- r++;
- *r=toupper((unsigned char)*r);
- } else {
- break;
+ while(++r<r_end){
+ if(isspace(*r)) {
+ if(r < r_end){
+ r++;
+ *r=toupper((unsigned char)*r);
+ } else {
+ break;
+ }
}
}
}