cvs: php4(PHP_4_3) /ext/standard reg.c
| From: | Moriyoshi Koizumi | Date: | Mon, 24 Feb 2003 16:19:44 +0000 |
| Subject: | cvs: php4(PHP_4_3) /ext/standard reg.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-19137@lists.php.net to get a copy of this message | ||
moriyoshi Mon Feb 24 11:19:44 2003 EDT
Modified files: (Branch: PHP_4_3)
/php4/ext/standard reg.c
Log:
MFH(r1.73): style fix
Index: php4/ext/standard/reg.c
diff -u php4/ext/standard/reg.c:1.66.2.3 php4/ext/standard/reg.c:1.66.2.4
--- php4/ext/standard/reg.c:1.66.2.3 Tue Dec 31 11:35:34 2002
+++ php4/ext/standard/reg.c Mon Feb 24 11:19:44 2003
@@ -17,7 +17,7 @@
| Jaakko Hyvätti <jaakko@hyvatti.iki.fi> |
+----------------------------------------------------------------------+
*/
-/* $Id: reg.c,v 1.66.2.3 2002/12/31 16:35:34 sebastian Exp $ */
+/* $Id: reg.c,v 1.66.2.4 2003/02/24 16:19:44 moriyoshi Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -278,10 +278,12 @@
string_len = strlen(string);
- if (icase)
+ if (icase) {
copts = REG_ICASE;
- if (extended)
+ }
+ if (extended) {
copts |= REG_EXTENDED;
+ }
err = regcomp(&re, pattern, copts);
if (err) {
@@ -321,7 +323,7 @@
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace;
- while (*walk)
+ while (*walk) {
if ('\\' == *walk && isdigit(walk[1]) && walk[1] - '0'
<= ((char) re.re_nsub)) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo
> -1) {
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
@@ -331,7 +333,7 @@
new_l++;
walk++;
}
-
+ }
if (new_l + 1 > buf_len) {
buf_len = 1 + buf_len + 2 * new_l;
nbuf = emalloc(buf_len);
@@ -346,7 +348,7 @@
/* copy replacement and backrefs */
walkbuf = &buf[tmp + subs[0].rm_so];
walk = replace;
- while (*walk)
+ while (*walk) {
if ('\\' == *walk && isdigit(walk[1]) && walk[1] - '0'
<= re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo
> -1
/* this next case shouldn't happen. it does. */
@@ -359,13 +361,15 @@
walk += 2;
} else {
*walkbuf++ = *walk++;
- }
+ }
+ }
*walkbuf = '\0';
/* and get ready to keep looking for replacements */
if (subs[0].rm_so == subs[0].rm_eo) {
- if (subs[0].rm_so + pos >= string_len)
+ if (subs[0].rm_so + pos >= string_len) {
break;
+ }
new_l = strlen (buf) + 1;
if (new_l + 1 > buf_len) {
buf_len = 1 + buf_len + 2 * new_l;