char *spec_walk = *spec;
char c = *spec_walk++;
int return_null = 0;
+ int alternate_form = 0;
- while (*spec_walk == '/' || *spec_walk == '!') {
+ /* scan through modifiers */
+ while (1) {
if (*spec_walk == '/') {
SEPARATE_ZVAL_IF_NOT_REF(arg);
- } else if (*spec_walk == '!' && Z_TYPE_PP(arg) == IS_NULL) {
- return_null = 1;
+ } else if (*spec_walk == '&') {
+ alternate_form = 1;
+ } else if (*spec_walk == '!') {
+ if (Z_TYPE_PP(arg) == IS_NULL) {
+ return_null = 1;
+ }
+ } else {
+ break;
}
spec_walk++;
}
int *pl = va_arg(*va, int *);
UConverter *conv = NULL;
- if (c == 's' && *spec_walk == '&') {
+ if (c == 's' && alternate_form) {
conv = va_arg(*va, UConverter *);
spec_walk++;
}