From: Rafael Garcia-Suarez Date: Thu, 8 Oct 2009 09:44:21 +0000 (+0200) Subject: Make tell() fail properly if called without an argument and when no previous file... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f03173f2c707a804ec3e9c291d2ab1adb9db4abc;p=p5sagit%2Fp5-mst-13.2.git Make tell() fail properly if called without an argument and when no previous file was read This makes tell() return -1, and sets errno to EBADF, thus restoring the 5.8.x behaviour --- diff --git a/pp_sys.c b/pp_sys.c index ec12cd4..9a1d1b3 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -2090,6 +2090,12 @@ PP(pp_tell) RETURN; } } + else { + if (!errno) + SETERRNO(EBADF,RMS_IFI); + PUSHi(-1); + RETURN; + } #if LSEEKSIZE > IVSIZE PUSHn( do_tell(gv) );