aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--edef.h8
-rw-r--r--globals.c17
-rw-r--r--search.c14
3 files changed, 14 insertions, 25 deletions
diff --git a/edef.h b/edef.h
index 1705f39..31fb735 100644
--- a/edef.h
+++ b/edef.h
@@ -115,14 +115,6 @@ extern char *patmatch;
extern struct line *matchline;
extern int matchoff;
-#if MAGIC
-extern short int magical;
-extern short int rmagical;
-extern struct magic mcpat[NPAT]; /* The magic pattern. */
-extern struct magic tapcm[NPAT]; /* The reversed magic patterni. */
-extern struct magic_replacement rmcpat[NPAT]; /* The replacement magic array. */
-#endif
-
extern char *dname[]; /* Directive name table. */
#if DEBUGM
diff --git a/globals.c b/globals.c
index 4488d60..235e2f3 100644
--- a/globals.c
+++ b/globals.c
@@ -119,21 +119,6 @@ char *patmatch = NULL;
struct line *matchline = NULL;
int matchoff = 0;
-#if MAGIC
-/*
- * The variables magical and rmagical determine if there
- * were actual metacharacters in the search and replace strings -
- * if not, then we don't have to use the slower MAGIC mode
- * search functions.
- */
-short int magical = FALSE;
-short int rmagical = FALSE;
-struct magic mcpat[NPAT]; /* the magic pattern */
-struct magic tapcm[NPAT]; /* the reversed magic pattern */
-struct magic_replacement rmcpat[NPAT]; /* the replacement magic array */
-
-#endif
-
/* directive name table:
This holds the names of all the directives.... */
@@ -148,5 +133,3 @@ char *dname[] = {
/* vars needed for macro debugging output */
char outline[NSTRING]; /* global string to hold debug line text */
#endif
-
-
diff --git a/search.c b/search.c
index 7f080d8..32877ab 100644
--- a/search.c
+++ b/search.c
@@ -64,6 +64,20 @@
#include "efunc.h"
#include "line.h"
+#if defined(MAGIC)
+/*
+ * The variables magical and rmagical determine if there
+ * were actual metacharacters in the search and replace strings -
+ * if not, then we don't have to use the slower MAGIC mode
+ * search functions.
+ */
+static short int magical;
+static short int rmagical;
+static struct magic mcpat[NPAT]; /* The magic pattern. */
+static struct magic tapcm[NPAT]; /* The reversed magic patterni. */
+static struct magic_replacement rmcpat[NPAT]; /* The replacement magic array. */
+#endif
+
static int amatch(struct magic *mcptr, int direct, struct line **pcwline, int *pcwoff);
static int readpattern(char *prompt, char *apat, int srch);
static int replaces(int kind, int f, int n);