diff: string__substring bug fix

Fergus Henderson fjh at cs.mu.oz.au
Thu Jul 24 02:24:10 AEST 1997


library/string.m:
	Fix a bug in string__substring: it counting the start
	position from the end of the string, rather than (as documented)
	from the start of the string.

Index: string.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/string.m,v
retrieving revision 1.93
diff -u -r1.93 string.m
--- string.m	1997/07/01 01:40:34	1.93
+++ string.m	1997/07/23 16:19:23
@@ -482,7 +482,7 @@
 	string__split(String, LeftCount, _LeftString, RightString).
 
 string__substring(String, Start, Count, Substring) :-
-	string__right(String, Start, Right),
+	string__split(String, Start, _Left, Right),
 	string__left(Right, Count, Substring).
 
 string__remove_suffix(A, B, C) :-

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list