From 1705fc460916b65351d2d155de2eeada07f652e8 Mon Sep 17 00:00:00 2001 From: Whiteknight Date: Thu, 2 Aug 2012 21:38:02 -0400 Subject: [PATCH] fix a readline-related build failure on g++. kid51++ for the catch --- src/pmc/socket.pmc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pmc/socket.pmc b/src/pmc/socket.pmc index 11aa7536fa..76d18ee5ba 100644 --- a/src/pmc/socket.pmc +++ b/src/pmc/socket.pmc @@ -424,8 +424,9 @@ present, it is used to determine line endings instead of the default C<\n>. METHOD readline(STRING *delimiter :optional, INTVAL has_delimiter :opt_flag) { - INTVAL delim = has_delimiter ? Parrot_str_indexed(INTERP, delimiter, 0) : '\n'; - STRING *result = Parrot_io_readline_s(INTERP, SELF, delim); + if (!has_delimiter) + delimiter = PARROT_SOCKET(SELF)->record_separator; + STRING *result = Parrot_io_readline_s(INTERP, SELF, delimiter); RETURN(STRING *result); }