=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sed/process.c,v retrieving revision 1.34 retrieving revision 1.35 diff -c -r1.34 -r1.35 *** src/usr.bin/sed/process.c 2018/11/14 10:59:33 1.34 --- src/usr.bin/sed/process.c 2022/01/12 15:13:36 1.35 *************** *** 1,4 **** ! /* $OpenBSD: process.c,v 1.34 2018/11/14 10:59:33 martijn Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. --- 1,4 ---- ! /* $OpenBSD: process.c,v 1.35 2022/01/12 15:13:36 martijn Exp $ */ /*- * Copyright (c) 1992 Diomidis Spinellis. *************** *** 60,66 **** static inline int applies(struct s_command *); static void flush_appends(void); ! static void lputs(char *); static inline int regexec_e(regex_t *, const char *, int, int, size_t, size_t); static void regsub(SPACE *, char *, char *); --- 60,66 ---- static inline int applies(struct s_command *); static void flush_appends(void); ! static void lputs(char *, size_t); static inline int regexec_e(regex_t *, const char *, int, int, size_t, size_t); static void regsub(SPACE *, char *, char *); *************** *** 158,164 **** (void)fprintf(outfile, "%s", cp->t); break; case 'l': ! lputs(ps); break; case 'n': if (!nflag && !pd) --- 158,164 ---- (void)fprintf(outfile, "%s", cp->t); break; case 'l': ! lputs(ps, psl); break; case 'n': if (!nflag && !pd) *************** *** 478,491 **** } static void ! lputs(char *s) { int count; extern int termwidth; const char *escapes; char *p; ! for (count = 0; *s; ++s) { if (count >= termwidth) { (void)fprintf(outfile, "\\\n"); count = 0; --- 478,491 ---- } static void ! lputs(char *s, size_t len) { int count; extern int termwidth; const char *escapes; char *p; ! for (count = 0; len > 0; len--, s++) { if (count >= termwidth) { (void)fprintf(outfile, "\\\n"); count = 0; *************** *** 501,507 **** } else { escapes = "\\\a\b\f\r\t\v"; (void)fputc('\\', outfile); ! if ((p = strchr(escapes, *s))) { (void)fputc("\\abfrtv"[p - escapes], outfile); count += 2; } else { --- 501,507 ---- } else { escapes = "\\\a\b\f\r\t\v"; (void)fputc('\\', outfile); ! if ((p = strchr(escapes, *s)) && *s != '\0') { (void)fputc("\\abfrtv"[p - escapes], outfile); count += 2; } else {