changeset 87:eaf37cfa30c2

fix string.gsub() git-svn-id: https://luan-java.googlecode.com/svn/trunk@88 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 27 Feb 2013 19:42:09 +0000
parents 6db8f286fa6c
children 6ca02b188dba
files src/luan/lib/StringLib.java
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/luan/lib/StringLib.java	Wed Feb 27 08:03:51 2013 +0000
+++ b/src/luan/lib/StringLib.java	Wed Feb 27 19:42:09 2013 +0000
@@ -166,7 +166,7 @@
 			int i = 0;
 			StringBuffer sb = new StringBuffer();
 			while( i<max && m.find() ) {
-				String match = m.groupCount()==0 ? m.group() : m.group(0);
+				String match = m.groupCount()==0 ? m.group() : m.group(1);
 				Object val = t.get(match);
 				if( Luan.toBoolean(val) ) {
 					String replacement = Luan.asString(val);