buffer to construct error messages.
with input by and ok millert@
-/* $OpenBSD: ed.h,v 1.20 2015/10/09 20:27:28 tobias Exp $ */
+/* $OpenBSD: ed.h,v 1.21 2015/10/09 21:24:05 tobias Exp $ */
/* $NetBSD: ed.h,v 1.23 1995/03/21 09:04:40 cgd Exp $ */
/* ed.h: type and constant definitions for the ed editor. */
/* global vars */
extern int addr_last;
extern int current_addr;
-extern char errmsg[PATH_MAX + 40];
extern int first_addr;
extern int lineno;
extern int second_addr;
-/* $OpenBSD: main.c,v 1.52 2015/10/09 20:27:28 tobias Exp $ */
+/* $OpenBSD: main.c,v 1.53 2015/10/09 21:24:05 tobias Exp $ */
/* $NetBSD: main.c,v 1.3 1995/03/21 09:04:44 cgd Exp $ */
/* main.c: This file contains the main control and user-interface routines
sigjmp_buf env;
/* static buffers */
+static char errmsg[PATH_MAX + 40]; /* error message buffer */
static char *shcmd; /* shell command buffer */
static int shcmdsz; /* shell command buffer size */
static int shcmdi; /* shell command buffer index */
-/* $OpenBSD: re.c,v 1.15 2015/10/09 20:27:28 tobias Exp $ */
+/* $OpenBSD: re.c,v 1.16 2015/10/09 21:24:05 tobias Exp $ */
/* $NetBSD: re.c,v 1.14 1995/03/21 09:04:48 cgd Exp $ */
/* re.c: This file contains the regular expression interface routines for
extern int patlock;
-char errmsg[PATH_MAX + 40] = "";
/* get_compiled_pattern: return pointer to compiled pattern from command
buffer */
get_compiled_pattern(void)
{
static regex_t *exp = NULL;
+ char errbuf[128] = "";
char *exps;
char delimiter;
}
patlock = 0;
if ((n = regcomp(exp, exps, 0)) != 0) {
- regerror(n, exp, errmsg, sizeof errmsg);
+ regerror(n, exp, errbuf, sizeof errbuf);
+ seterrmsg(errbuf);
free(exp);
return exp = NULL;
}