summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkjell <kjell@openbsd.org>2005-11-18 17:35:17 +0000
committerkjell <kjell@openbsd.org>2005-11-18 17:35:17 +0000
commit2c3ccd67cd43538f305989cd0ecbc2d3a420c775 (patch)
treee03527c89e0efe803466481d2859727a391b84df
parentKill a stupid interface. kgrow should take direction, not TRUE/FALSE. (diff)
downloadwireguard-openbsd-2c3ccd67cd43538f305989cd0ecbc2d3a420c775.tar.xz
wireguard-openbsd-2c3ccd67cd43538f305989cd0ecbc2d3a420c775.zip
Casefold on replace was killed ages ago (it was wrong). Remove a
leftover (unused) variable.
-rw-r--r--usr.bin/mg/def.h4
-rw-r--r--usr.bin/mg/line.c4
-rw-r--r--usr.bin/mg/re_search.c19
-rw-r--r--usr.bin/mg/search.c10
4 files changed, 16 insertions, 21 deletions
diff --git a/usr.bin/mg/def.h b/usr.bin/mg/def.h
index db57dea3568..87ecd96c97b 100644
--- a/usr.bin/mg/def.h
+++ b/usr.bin/mg/def.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: def.h,v 1.72 2005/11/07 23:32:20 kjell Exp $ */
+/* $OpenBSD: def.h,v 1.73 2005/11/18 17:35:17 kjell Exp $ */
/* This file is in the public domain. */
@@ -353,7 +353,7 @@ int lnewline_at(LINE *, int);
int lnewline(void);
int ldelete(RSIZE, int);
int ldelnewline(void);
-int lreplace(RSIZE, char *, int);
+int lreplace(RSIZE, char *);
void kdelete(void);
int kinsert(int, int);
int kremove(int);
diff --git a/usr.bin/mg/line.c b/usr.bin/mg/line.c
index 0c8311fc6f6..814b8c0903d 100644
--- a/usr.bin/mg/line.c
+++ b/usr.bin/mg/line.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: line.c,v 1.26 2005/11/18 17:19:51 kjell Exp $ */
+/* $OpenBSD: line.c,v 1.27 2005/11/18 17:35:17 kjell Exp $ */
/* This file is in the public domain. */
@@ -578,7 +578,7 @@ ldelnewline(void)
* was there).
*/
int
-lreplace(RSIZE plen, char *st, int f)
+lreplace(RSIZE plen, char *st)
{
RSIZE rlen; /* replacement length */
diff --git a/usr.bin/mg/re_search.c b/usr.bin/mg/re_search.c
index 9a3fb21d3d5..70fa6eb48c2 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.19 2005/10/14 15:41:33 deraadt Exp $ */
+/* $OpenBSD: re_search.c,v 1.20 2005/11/18 17:35:17 kjell Exp $ */
/* This file is in the public domain. */
@@ -34,7 +34,7 @@ char re_pat[NPAT]; /* regex pattern */
int re_srch_lastdir = SRCH_NOPR; /* last search flags */
int casefoldsearch = TRUE; /* does search ignore case? */
-static int re_doreplace(RSIZE, char *, int);
+static int re_doreplace(RSIZE, char *);
static int re_forwsrch(void);
static int re_backsrch(void);
static int re_readpattern(char *);
@@ -134,10 +134,6 @@ re_queryrepl(int f, int n)
int plen, s; /* length of found string */
char news[NPAT]; /* replacement string */
- /* Casefold check */
- if (!casefoldsearch)
- f = TRUE;
-
if ((s = re_readpattern("RE Query replace")) != TRUE)
return (s);
if (eread("Query replace %s with: ", news, NPAT,
@@ -156,14 +152,14 @@ retry:
switch (getkey(FALSE)) {
case ' ':
plen = re_match[0].rm_eo - re_match[0].rm_so;
- if (re_doreplace((RSIZE)plen, news, f) == FALSE)
+ if (re_doreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
break;
case '.':
plen = re_match[0].rm_eo - re_match[0].rm_so;
- if (re_doreplace((RSIZE)plen, news, f) == FALSE)
+ if (re_doreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
goto stopsearch;
@@ -176,7 +172,7 @@ retry:
case '!':
do {
plen = re_match[0].rm_eo - re_match[0].rm_so;
- if (re_doreplace((RSIZE)plen, news, f) == FALSE)
+ if (re_doreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
} while (re_forwsrch() == TRUE);
@@ -210,10 +206,9 @@ stopsearch:
* re_query replace. Its reason for existence is to deal with \1, \2. etc.
* plen: length to remove
* st: replacement string
- * f: case hack disable
*/
static int
-re_doreplace(RSIZE plen, char *st, int f)
+re_doreplace(RSIZE plen, char *st)
{
int j, k, s, more, num, state;
LINE *clp;
@@ -290,7 +285,7 @@ re_doreplace(RSIZE plen, char *st, int f)
} /* while (more) */
repstr[j] = '\0';
- s = lreplace(plen, repstr, f);
+ s = lreplace(plen, repstr);
return (s);
}
diff --git a/usr.bin/mg/search.c b/usr.bin/mg/search.c
index 3f71f25c086..e3ebcd29510 100644
--- a/usr.bin/mg/search.c
+++ b/usr.bin/mg/search.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: search.c,v 1.23 2005/10/11 01:00:41 kjell Exp $ */
+/* $OpenBSD: search.c,v 1.24 2005/11/18 17:35:17 kjell Exp $ */
/* This file is in the public domain. */
@@ -553,12 +553,12 @@ retry:
switch (getkey(FALSE)) {
case 'y':
case ' ':
- if (lreplace((RSIZE)plen, news, f) == FALSE)
+ if (lreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
break;
case '.':
- if (lreplace((RSIZE)plen, news, f) == FALSE)
+ if (lreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
goto stopsearch;
@@ -570,7 +570,7 @@ retry:
goto stopsearch;
case '!':
do {
- if (lreplace((RSIZE)plen, news, f) == FALSE)
+ if (lreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;
} while (forwsrch() == TRUE);
@@ -617,7 +617,7 @@ replstr(int f, int n)
plen = strlen(pat);
while (forwsrch() == TRUE) {
update();
- if (lreplace((RSIZE)plen, news, f) == FALSE)
+ if (lreplace((RSIZE)plen, news) == FALSE)
return (FALSE);
rcnt++;