diff options
author | 2003-12-31 18:18:22 +0000 | |
---|---|---|
committer | 2003-12-31 18:18:22 +0000 | |
commit | b4df0ae31bc5e1641d02f165a61b5fe8b36cdfa9 (patch) | |
tree | ae55a02df6ce2af383a91782ebf32f03e73a1c6d | |
parent | Test new interface syntax. (diff) | |
download | wireguard-openbsd-b4df0ae31bc5e1641d02f165a61b5fe8b36cdfa9.tar.xz wireguard-openbsd-b4df0ae31bc5e1641d02f165a61b5fe8b36cdfa9.zip |
Both POSIX and the man page says that "vi -r foo" is run where foo does not
exist and has no recovery file that vi shall present an error and edit
foo as a new file. This change makes the behavior match the documentation;
previously it just spat out an error and quit. Problem found by jmc@
-rw-r--r-- | usr.bin/vi/common/exf.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index 0943febb5c3..94046cc8392 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.19 2003/08/01 16:47:25 pvalchev Exp $ */ +/* $OpenBSD: exf.c,v 1.20 2003/12/31 18:18:22 millert Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -150,7 +150,8 @@ file_init(sp, frp, rcv_name, flags) */ if (F_ISSET(frp, FR_RECOVER)) { F_CLR(frp, FR_RECOVER); - return (rcv_read(sp, frp)); + if (rcv_read(sp, frp) == 0) + return (0); /* successful recovery */ } /* |