[mercury-users] io__read_line_as_string predicate problem

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Mar 25 14:30:23 AEDT 2003


On 24-Mar-2003, Petr Nemec <xanthar at seznam.cz> wrote:
> It is exactly so. The call to io__read_line_as_string ends up with 
> "error(io_error("read failed: error 0"))". 
> The charset is non-ASCII (ISO-8859-2, Czech letters). I am using
> binary distribution of Mercury 10.1. on CygWin.

Fixed thusly.

library/io.m:
	Fix a bug in the C code for io__read_line_as_string which
	caused it to fail for characters with numerical values >= 128.

Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.294
diff -u -d -r1.294 io.m
--- library/io.m	3 Mar 2003 03:29:37 -0000	1.294
+++ library/io.m	25 Mar 2003 03:25:21 -0000
@@ -1681,7 +1681,7 @@
 			}
 			break;
 		}
-		if (char_code != (MR_Char) char_code) {
+		if (char_code != (MR_UnsignedChar) char_code) {
 			Res = -2;
 			break;
 		}
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list