shithub: libmujs

Download patch

ref: 9b151f1513f385c04b1eef13bc33ac6d9494d1aa
parent: 5e3e9fdde43fa7c5243f3180405ddaeaf2329880
author: Tor Andersson <tor.andersson@artifex.com>
date: Mon Jan 5 08:10:07 EST 2015

Fix test for empty string in String.prototype.split with regexp.

--- a/jsstring.c
+++ b/jsstring.c
@@ -559,7 +559,7 @@
 	e = text + strlen(text);
 
 	/* splitting the empty string */
-	if (e == 0) {
+	if (e == text) {
 		if (js_regexec(re->prog, text, &m, 0)) {
 			if (len == limit) return;
 			js_pushliteral(J, "");