Skip to content

Commit adb0df9

Browse files
committed
Fix empty string
1 parent e90e972 commit adb0df9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

ext/intl/grapheme/grapheme_string.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,8 @@ U_CFUNC PHP_FUNCTION(grapheme_strrev)
11751175
ubrk_setUText(bi, ut, &ustatus);
11761176
pos = ubrk_last(bi);
11771177
if (pos == UBRK_DONE) {
1178-
goto close;
1178+
RETVAL_EMPTY_STRING();
1179+
goto ubrk_end;
11791180
}
11801181

11811182
current = ZSTR_LEN(string);
@@ -1189,6 +1190,7 @@ U_CFUNC PHP_FUNCTION(grapheme_strrev)
11891190
}
11901191

11911192
RETVAL_NEW_STR(ret);
1193+
ubrk_end:
11921194
ubrk_close(bi);
11931195
close:
11941196
utext_close(ut);

0 commit comments

Comments
 (0)