diff options
author | Craig A. Berry <craigberry@mac.com> | 2014-06-08 18:14:57 -0500 |
---|---|---|
committer | Craig A. Berry <craigberry@mac.com> | 2014-06-08 20:33:09 -0500 |
commit | 5876737a160ce8f490b3d77eb7edd87391db1968 (patch) | |
tree | 260f71fa72e0a53ca30af22312f8cffd8913fa4e /perlio.c | |
parent | ba5248fcde21acfb9d93220ec07256804525c18e (diff) | |
download | perl-5876737a160ce8f490b3d77eb7edd87391db1968.tar.gz |
Eliminate VMS-specific code in PerlIOStdio_fill.
The same logic but with more safety checks is already defined for
PerlSIO_ungetc in iperlsys.h, so DRY says we should just use that.
Also, that definition in iperlsys.h really depends on the library
we are using, not the compiler. And there is only one viable C
library on VMS and it ships with the OS, so it's really just an
OS dependency.
N.B. While it may be something of a fool's errand to maintain the
stdio layer, deleting redundant code can only be a good thing,
possibly enabling further refactoring and clean-up.
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 10 |
1 files changed, 1 insertions, 9 deletions
@@ -3624,20 +3624,12 @@ PerlIOStdio_fill(pTHX_ PerlIO *f) } #endif -#if defined(VMS) - /* An ungetc()d char is handled separately from the regular - * buffer, so we stuff it in the buffer ourselves. - * Should never get called as should hit code above - */ - *(--((*stdio)->_ptr)) = (unsigned char) c; - (*stdio)->_cnt++; -#else /* If buffer snoop scheme above fails fall back to using ungetc(). */ if (PerlSIO_ungetc(c, stdio) != c) return EOF; -#endif + return 0; } |