summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNayden Markatchev <nayden@cvs.openbsd.org>2017-08-27 00:29:05 +0000
committerNayden Markatchev <nayden@cvs.openbsd.org>2017-08-27 00:29:05 +0000
commitaa07f7ad898c2a9010e40fae4b7fc5615857af99 (patch)
tree95bc47643c82e28f0d21090a038830acd47a7862
parent6b42b5938cbe29ee22346a03b5279ea6efad53d9 (diff)
Remove unused copy_non_glob() in ksh.
Report and diff by David Crosby <dave@dafyddcrosby.com> OK otto@
-rw-r--r--bin/ksh/eval.c44
1 files changed, 1 insertions, 43 deletions
diff --git a/bin/ksh/eval.c b/bin/ksh/eval.c
index ee8f3132727..49b4fdd5309 100644
--- a/bin/ksh/eval.c
+++ b/bin/ksh/eval.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eval.c,v 1.53 2017/07/04 11:46:15 anton Exp $ */
+/* $OpenBSD: eval.c,v 1.54 2017/08/27 00:29:04 nayden Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
@@ -1076,7 +1076,6 @@ globit(XString *xs, /* dest string */
int len;
int prefix_len;
- /* xp = *xpp; copy_non_glob() may have re-alloc'd xs */
*xp = '\0';
prefix_len = Xlength(*xs, xp);
dirp = opendir(prefix_len ? Xstring(*xs, xp) : ".");
@@ -1108,47 +1107,6 @@ globit(XString *xs, /* dest string */
*--np = odirsep;
}
-#if 0
-/* Check if p contains something that needs globbing; if it does, 0 is
- * returned; if not, p is copied into xs/xp after stripping any MAGICs
- */
-static int copy_non_glob(XString *xs, char **xpp, char *p);
-static int
-copy_non_glob(XString *xs, char **xpp, char *p)
-{
- char *xp;
- int len = strlen(p);
-
- XcheckN(*xs, *xpp, len);
- xp = *xpp;
- for (; *p; p++) {
- if (ISMAGIC(*p)) {
- int c = *++p;
-
- if (c == '*' || c == '?')
- return 0;
- if (*p == '[') {
- char *q = p + 1;
-
- if (ISMAGIC(*q) && q[1] == '!')
- q += 2;
- if (ISMAGIC(*q) && q[1] == ']')
- q += 2;
- for (; *q; q++)
- if (ISMAGIC(*q) && *++q == ']')
- return 0;
- /* pass a literal [ through */
- }
- /* must be a MAGIC-MAGIC, or MAGIC-!, MAGIC--, etc. */
- }
- *xp++ = *p;
- }
- *xp = '\0';
- *xpp = xp;
- return 1;
-}
-#endif /* 0 */
-
/* remove MAGIC from string */
char *
debunk(char *dp, const char *sp, size_t dlen)