summaryrefslogtreecommitdiff
path: root/x2p/str.c
diff options
context:
space:
mode:
Diffstat (limited to 'x2p/str.c')
-rw-r--r--x2p/str.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/x2p/str.c b/x2p/str.c
index 953a811f50..45b40f7fb8 100644
--- a/x2p/str.c
+++ b/x2p/str.c
@@ -297,6 +297,16 @@ register FILE *fp;
int i;
int bpx;
+#if defined(VMS)
+ /* An ungetc()d char is handled separately from the regular
+ * buffer, so we getc() it back out and stuff it in the buffer.
+ */
+ i = getc(fp);
+ if (i == EOF) return Nullch;
+ *(--((*fp)->_ptr)) = (unsigned char) i;
+ (*fp)->_cnt++;
+#endif
+
cnt = FILE_cnt(fp); /* get count into register */
str->str_nok = 0; /* invalidate number */
str->str_pok = 1; /* validate pointer */
@@ -317,7 +327,7 @@ register FILE *fp;
FILE_cnt(fp) = cnt; /* deregisterize cnt and ptr */
FILE_ptr(fp) = ptr;
- i = FILE_filbuf(fp); /* get more characters */
+ i = getc(fp); /* get more characters */
cnt = FILE_cnt(fp);
ptr = FILE_ptr(fp); /* reregisterize cnt and ptr */