diff options
author | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-06-14 00:55:46 +0000 |
---|---|---|
committer | Kjell Wooding <kjell@cvs.openbsd.org> | 2005-06-14 00:55:46 +0000 |
commit | d6a8c1f431467a33f928c4361025688640d5bc32 (patch) | |
tree | 42a0ef973195ae7f4af600b44e5eee3fe6687ff0 | |
parent | 1988b282fcac95051f4710fd91f8a6bbcb1395a5 (diff) |
Three more ereply that should be ereads. This fixes henning's "replace
with null string is busted" observation.
ok henning@, cloder@
-rw-r--r-- | usr.bin/mg/re_search.c | 6 | ||||
-rw-r--r-- | usr.bin/mg/search.c | 8 |
2 files changed, 8 insertions, 6 deletions
diff --git a/usr.bin/mg/re_search.c b/usr.bin/mg/re_search.c index 3aa91b89d21..c516f33c328 100644 --- a/usr.bin/mg/re_search.c +++ b/usr.bin/mg/re_search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re_search.c,v 1.15 2005/06/05 05:15:56 kjell Exp $ */ +/* $OpenBSD: re_search.c,v 1.16 2005/06/14 00:55:45 kjell Exp $ */ /* * regular expression search commands for Mg @@ -138,8 +138,8 @@ re_queryrepl(int f, int n) if ((s = re_readpattern("RE Query replace")) != TRUE) return (s); - if ((rep = - ereply("Query replace %s with: ", news, NPAT, re_pat)) == NULL) + if ((rep = eread("Query replace %s with: ", news, NPAT, + EFNUL | EFNEW | EFCR, re_pat)) == NULL) return (ABORT); ewprintf("Query replacing %s with %s:", re_pat, news); diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c index 70c31df5e85..182107795d4 100644 --- a/usr.bin/mg/search.c +++ b/usr.bin/mg/search.c @@ -1,4 +1,4 @@ -/* $OpenBSD: search.c,v 1.19 2005/06/05 05:15:56 kjell Exp $ */ +/* $OpenBSD: search.c,v 1.20 2005/06/14 00:55:45 kjell Exp $ */ /* * Search commands. @@ -532,7 +532,8 @@ queryrepl(int f, int n) if ((s = readpattern("Query replace")) != TRUE) return (s); - if ((rep = ereply("Query replace %s with: ", news, NPAT, pat)) == NULL) + if ((rep = eread("Query replace %s with: ", news, NPAT, + EFNUL | EFNEW | EFCR, pat)) == NULL) return (ABORT); else if (rep[0] == '\0') news[0] = '\0'; @@ -605,7 +606,8 @@ replstr(int f, int n) if ((s = readpattern("Replace string")) != TRUE) return s; - r = ereply("Replace string %s with: ", news, NPAT, pat); + r = eread("Replace string %s with: ", news, NPAT, + EFNUL | EFNEW | EFCR, pat); if (r == NULL) return (ABORT); |