SCCS-vsn: contrib/ed/ed.h 5.4
SCCS-vsn: contrib/ed/input_lines.c 5.5
SCCS-vsn: contrib/ed/main.c 5.5
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)ed.h 5.3 (Berkeley) %G%
+ * @(#)ed.h 5.4 (Berkeley) %G%
*/
#define FILENAME_LEN PATH_MAX
*/
#define FILENAME_LEN PATH_MAX
#define INTERUPT (int)1
#define HANGUP (int)2
#define SIGINT_ACTION longjmp(ctrl_position, INTERUPT)
#define INTERUPT (int)1
#define HANGUP (int)2
#define SIGINT_ACTION longjmp(ctrl_position, INTERUPT)
-#define SIGINT_ILACTION longjmp(ctrl_position2, INTERUPT)
+#define SIGINT_ALACTION longjmp(ctrl_position2, INTERUPT)
+#define SIGINT_ILACTION longjmp(ctrl_position3, INTERUPT)
#define SIGHUP_ACTION longjmp(ctrl_position, HANGUP)
#define NN_MAX_START 510
#ifndef STDOUT_FILENO
#define SIGHUP_ACTION longjmp(ctrl_position, HANGUP)
#define NN_MAX_START 510
#ifndef STDOUT_FILENO
extern int u_set, line_length;
extern struct d_layer *d_stk;
extern int u_set, line_length;
extern struct d_layer *d_stk;
-extern int sigint_flag, sighup_flag, sigspecial, sigspecial2;
-extern jmp_buf ctrl_position, ctrl_position2;
+extern int sigint_flag, sighup_flag, sigspecial, sigspecial2, sigspecial3;
+extern jmp_buf ctrl_position, ctrl_position2, ctrl_position3;
#define RE_SEC 10
extern regex_t RE_comp;
#define RE_SEC 10
extern regex_t RE_comp;
-static char sccsid[] = "@(#)input_lines.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)input_lines.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
-#ifdef DBI
-#include <db.h>
-#endif
-
#include "ed.h"
#include "extern.h"
#include "ed.h"
#include "extern.h"
register char *l_text = text;
LINE *l_temp_line, *l_temp1;
long l_ttl = 0;
register char *l_text = text;
LINE *l_temp_line, *l_temp1;
long l_ttl = 0;
+ int l_nn_max = nn_max, l_jmp_flag;
char *l_text2;
if (End_default)
char *l_text2;
if (End_default)
SIGINT_ACTION;
sigspecial++;
SIGINT_ACTION;
sigspecial++;
+ if (l_jmp_flag = setjmp(ctrl_position3))
+ goto point;
for (;;) {
if (sigint_flag && (!sigspecial))
goto point;
for (;;) {
if (sigint_flag && (!sigspecial))
goto point;
- /* If NULL or bit-8 high not text; chuck. */
if (l_ss == EOF) {
if (add_flag) {
l_text[l_nn++] = '\0';
if (l_ss == EOF) {
if (add_flag) {
l_text[l_nn++] = '\0';
- if ((!l_ss) || (l_ss > 127))
+ if (!l_ss) /* 8-bit okay, but NULL not */
continue;
l_text[l_nn++] = (char)l_ss;
if (l_ss == '\n') {
continue;
l_text[l_nn++] = (char)l_ss;
if (l_ss == '\n') {
if ((l_nn == 2) && (l_text[0] == '.') && add_flag)
break;
eof_mk:
if ((l_nn == 2) && (l_text[0] == '.') && add_flag)
break;
eof_mk:
- nn_max_end = malloc(sizeof(LINE));
+ nn_max_end = (LINE *)malloc(sizeof(LINE));
if (nn_max_end == NULL) {
*errnum = -1;
strcpy(help_msg, "out of memory error");
if (nn_max_end == NULL) {
*errnum = -1;
strcpy(help_msg, "out of memory error");
}
change_flag = 1;
sigspecial--;
}
change_flag = 1;
sigspecial--;
if (sigint_flag && (!sigspecial))
SIGINT_ACTION;
*errnum = 1;
ss = l_ss;
if (sigint_flag && (!sigspecial))
SIGINT_ACTION;
*errnum = 1;
ss = l_ss;
-static char sccsid[] = "@(#)main.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)main.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#include <sys/ioctl.h>
#endif /* not lint */
#include <sys/types.h>
#include <sys/ioctl.h>
#include <regex.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <regex.h>
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef DBI
#include <db.h>
#ifdef DBI
#include <db.h>
int explain_flag=1, g_flag=0, GV_flag=0, printsfx=0;
long change_flag=0L;
int line_length;
int explain_flag=1, g_flag=0, GV_flag=0, printsfx=0;
long change_flag=0L;
int line_length;
-jmp_buf ctrl_position, ctrl_position2; /* For SIGnal handling. */
-int sigint_flag, sighup_flag, sigspecial=0, sigspecial2=0;
+jmp_buf ctrl_position, ctrl_position2, ctrl_position3; /* For SIGnal handling. */
+int sigint_flag, sighup_flag, sigspecial=0, sigspecial2=0, sigspecial3=0;
static void sigint_handler __P((int));
static void sighup_handler __P((int));
static void sigint_handler __P((int));
static void sighup_handler __P((int));
int signo;
{
sigint_flag = 1;
int signo;
{
sigint_flag = 1;
+ if (sigspecial3) {
+ sigspecial3 = 0;
+ SIGINT_ILACTION;
+ }
if (sigspecial2) {
sigspecial2 = 0;
if (sigspecial2) {
sigspecial2 = 0;