From: Hans Mulder Date: Thu, 9 Jul 1998 16:51:27 +0000 (-0700) Subject: make binmode(STDIN) not whine X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bf6b5eb4157d8ec84b03a82e6575ebd58812ca0a;p=p5sagit%2Fp5-mst-13.2.git make binmode(STDIN) not whine Message-Id: <3.0.5.32.19980709165127.00a692e0@ous.edu> Subject: [PATCH 5.004_70] Fix up binmode() for VMS p4raw-id: //depot/perl@1411 --- diff --git a/vms/vms.c b/vms/vms.c index ac5ac9c..f41b1e1 100644 --- a/vms/vms.c +++ b/vms/vms.c @@ -4168,7 +4168,7 @@ my_binmode(FILE *fp, char iotype) if (s == dirend + 3) return fp; /* If we've got a non-file-structured device, clip off the trailing * junk, and don't lose sleep if we can't get a stream position. */ - if (dirend == Nullch) *(colon+1) = '\0'; + if (dirend == Nullch) *(colon+1) = '\0'; if (iotype != '-'&& (ret = fgetpos(fp, &pos)) == -1 && dirend) return NULL; switch (iotype) { case '<': case 'r': acmode = "rb"; break; @@ -4178,8 +4178,12 @@ my_binmode(FILE *fp, char iotype) case 'a': acmode = "ab"; break; case '+': case 's': acmode = "rb+"; break; case '-': acmode = fileno(fp) ? "ab" : "rb"; break; + /* iotype'll be null for the SYS$INPUT:/SYS$OUTPUT:/SYS$ERROR: files */ + /* since we didn't really open them and can't really */ + /* reopen them */ + case 0: return NULL; break; default: - warn("Unrecognized iotype %c in my_binmode",iotype); + warn("Unrecognized iotype %x for %s in my_binmode",iotype, filespec); acmode = "rb+"; } if (freopen(filespec,acmode,fp) == NULL) return NULL;