summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-05-15 02:15:25 +0000
commit6ff81951f79dec32e15a779d288c1047f0e4fefb (patch)
tree53c645778f7a018e0bd74a2ec2fe9c64833ea13d /util.c
parent48c036b1eb8f866b948f33704ee6152323a5aad9 (diff)
downloadperl-6ff81951f79dec32e15a779d288c1047f0e4fefb.tar.gz
[win32] merge changes#906,907,909,910 from maintbranch
p4raw-link: @910 on //depot/maint-5.004/perl: ae941ac0da8f453f0d31df7b7293e50b3e5a46f1 p4raw-link: @909 on //depot/maint-5.004/perl: 8b3d696ffd11cf2e49f6eaa575b829ab0a55352d p4raw-link: @907 on //depot/maint-5.004/perl: 3cb3c1abada5765ba4166ebe59e2e20d737ec21b p4raw-link: @906 on //depot/maint-5.004/perl: ae389c8a29b487f4434c465442dfb611507a4a38 p4raw-id: //depot/win32/perl@977
Diffstat (limited to 'util.c')
-rw-r--r--util.c45
1 files changed, 4 insertions, 41 deletions
diff --git a/util.c b/util.c
index 866e598bf6..22af92170b 100644
--- a/util.c
+++ b/util.c
@@ -1835,46 +1835,6 @@ VTOH(vtohs,short)
VTOH(vtohl,long)
#endif
-int
-do_binmode(PerlIO *fp, int iotype, int flag)
-{
- if (flag != TRUE)
- croak("panic: unsetting binmode"); /* Not implemented yet */
-#ifdef DOSISH
-#ifdef atarist
- if (!PerlIO_flush(fp) && (fp->_flag |= _IOBIN))
- return 1;
- else
- return 0;
-#else
- if (PerlLIO_setmode(PerlIO_fileno(fp), OP_BINARY) != -1) {
-#if defined(WIN32) && defined(__BORLANDC__)
- /* The translation mode of the stream is maintained independent
- * of the translation mode of the fd in the Borland RTL (heavy
- * digging through their runtime sources reveal). User has to
- * set the mode explicitly for the stream (though they don't
- * document this anywhere). GSAR 97-5-24
- */
- PerlIO_seek(fp,0L,0);
- fp->flags |= _F_BIN;
-#endif
- return 1;
- }
- else
- return 0;
-#endif
-#else
-#if defined(USEMYBINMODE)
- if (my_binmode(fp,iotype) != NULL)
- return 1;
- else
- return 0;
-#else
- return 1;
-#endif
-#endif
-}
-
/* VMS' my_popen() is in VMS.c, same with OS/2. */
#if (!defined(DOSISH) || defined(HAS_FORK) || defined(AMIGAOS)) && !defined(VMS)
PerlIO *
@@ -2429,7 +2389,7 @@ scan_hex(char *start, I32 len, I32 *retlen)
register char *s = start;
register UV retval = 0;
bool overflowed = FALSE;
- char *tmp;
+ char *tmp = s;
while (len-- && *s && (tmp = strchr((char *) hexdigit, *s))) {
register UV n = retval << 4;
@@ -2440,6 +2400,9 @@ scan_hex(char *start, I32 len, I32 *retlen)
retval = n | ((tmp - hexdigit) & 15);
s++;
}
+ if (dowarn && !tmp) {
+ warn("Illegal hex digit ignored");
+ }
*retlen = s - start;
return retval;
}