← Commit list

25d82397f

Rob Landley
Rob Landley
2004-04-01
FAILED Duration: 77s

Subject

The last patch broke: sed -i "/^boo/a fred" ipsec.conf

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

editors/sed.c+8 -3
@@ -6,6 +6,7 @@
* Copyright (C) 1999,2000,2001 by Mark Whitley <[email protected]>
* Copyright (C) 2002 Matt Kraai
* Copyright (C) 2003 by Glenn McGrath <[email protected]>
+ * Copyright (C) 2003,2004 by Rob Landley <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -410,9 +411,13 @@ static char *parse_cmd_args(sed_cmd_t *sed_cmd, char *cmdstr)
if ((sed_cmd->end_line || sed_cmd->end_match) && sed_cmd->cmd != 'c')
bb_error_msg_and_die
("only a beginning address can be specified for edit commands");
- if (*cmdstr != '\n') /* should not happen */
- bb_error_msg_and_die("A/I/C backslash not followed by NL?");
- cmdstr++; /* skip over the NL following the backslash */
+ for(;;) {
+ if(*cmdstr=='\n' || *cmdstr=='\\') {
+ cmdstr++;
+ break;
+ } else if(isspace(*cmdstr)) cmdstr++;
+ else break;
+ }
sed_cmd->string = bb_xstrdup(cmdstr);
parse_escapes(sed_cmd->string,sed_cmd->string,strlen(cmdstr),0,0);
cmdstr += strlen(cmdstr);