summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-07-17 14:08:48 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-07-17 14:08:48 +0000
commitcbe9e2031df1ef1fc18849ffe4581d788a72931d (patch)
treeded6777a3198604e968f0d5801203e7effc59368 /sv.c
parentf2c4f5ffe7d343358429e3e051b09862f704c868 (diff)
downloadperl-cbe9e2031df1ef1fc18849ffe4581d788a72931d.tar.gz
NI-S' stab at the #17270 mystery.
p4raw-id: //depot/perl@17601
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/sv.c b/sv.c
index bdae1a6a9e..2c31193985 100644
--- a/sv.c
+++ b/sv.c
@@ -5884,32 +5884,18 @@ screamer2:
/* Accomodate broken VAXC compiler, which applies U8 cast to
* both args of ?: operator, causing EOF to change into 255
*/
- /* For some reason #17270 broke things for DJGPP and NetWare.
- * Another hunk just below. */
-#if defined(DJGPP) || defined(NETWARE)
- if (cnt)
-#else
if (cnt > 0)
-#endif
- {
- i = (U8)buf[cnt - 1];
- }
- else {
+ i = (U8)buf[cnt - 1];
+ else
i = EOF;
- }
}
- /* This is basically undoing #17270 for DJGPP and NetWare.
- * Another hunk just above. */
-#if !(defined(DJGPP) || defined(NETWARE))
- if (cnt > 0)
-#endif
- {
- if (append)
- sv_catpvn(sv, (char *) buf, cnt);
- else
- sv_setpvn(sv, (char *) buf, cnt);
- }
+ if (cnt < 0)
+ cnt = 0; /* we do need to re-set the sv even when cnt <= 0 */
+ if (append)
+ sv_catpvn(sv, (char *) buf, cnt);
+ else
+ sv_setpvn(sv, (char *) buf, cnt);
if (i != EOF && /* joy */
(!rslen ||