--- usr.bin/sed/compile.c (revision 307676) +++ usr.bin/sed/compile.c (working copy) @@ -746,6 +746,9 @@ while (cu_fgets(lbuf, sizeof(lbuf), NULL) != NULL) { op = s = text + size; p = lbuf; +#ifdef LEGACY_BSDSED_COMPAT + EATSPACE(); +#endif for (esc_nl = 0; *p != '\0'; p++) { if (*p == '\\' && p[1] != '\0' && *++p == '\n') esc_nl = 1;