summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2014-06-08 18:14:57 -0500
committerCraig A. Berry <craigberry@mac.com>2014-06-08 20:33:09 -0500
commit5876737a160ce8f490b3d77eb7edd87391db1968 (patch)
tree260f71fa72e0a53ca30af22312f8cffd8913fa4e /perlio.c
parentba5248fcde21acfb9d93220ec07256804525c18e (diff)
downloadperl-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.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/perlio.c b/perlio.c
index 90622c1e6e..d41c2f54e8 100644
--- a/perlio.c
+++ b/perlio.c
@@ -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;
}