Mercurial > hg > octave-avbm
changeset 372:c91ba20cd123
[project @ 1994-02-17 07:50:58 by jwe]
author | jwe |
---|---|
date | Thu, 17 Feb 1994 07:50:58 +0000 |
parents | 49b0a405c069 |
children | 916b341acffd |
files | src/file-io.cc |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/file-io.cc +++ b/src/file-io.cc @@ -244,13 +244,15 @@ struct stat buffer; int status = stat (name, &buffer); - if (status == 0 || (status < 0 && *mode != 'r')) + if (status == 0) { if ((buffer.st_mode & S_IFREG) == S_IFREG) p = fopen_file_for_user (arg, mode, warn_for); else error ("%s: invalid file type", warn_for); } + else if (status < 0 && *mode != 'r') + p = fopen_file_for_user (arg, mode, warn_for); else error ("%s: can't stat file `%s'", warn_for, name); }