← Commit list

0a65e190f

Glenn L McGrath
Glenn L McGrath
2002-12-23
SOURCE BUG Duration: 18s

Subject

Support the '=' command

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): sysdeps/linux/Config.in "fileutils/Config.in" dosyasini kaynak gosteriyor ama bu dosya repoda hic var olmadi (2002-12-05 - 2003-02-15 arasi orijinal yazar hatasi, 3238ea167 ile duzeltildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

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+5 -3
@@ -431,7 +431,7 @@ static char *parse_cmd_str(struct sed_cmd * const sed_cmd, const char *const cmd
/* if it was a single-letter command that takes no arguments (such as 'p'
* or 'd') all we need to do is increment the index past that command */
- if (strchr("pd", sed_cmd->cmd)) {
+ if (strchr("pd=", sed_cmd->cmd)) {
idx++;
}
/* handle (s)ubstitution command */
@@ -451,7 +451,7 @@ static char *parse_cmd_str(struct sed_cmd * const sed_cmd, const char *const cmd
idx += parse_file_cmd(sed_cmd, &cmdstr[idx]);
}
else {
- error_msg_and_die("invalid command");
+ error_msg_and_die("Unsupported command %c", sed_cmd->cmd);
}
/* give back whatever's left over */
@@ -685,7 +685,9 @@ static void process_file(FILE *file)
* actual sedding
*/
switch (sed_cmd->cmd) {
-
+ case '=':
+ printf("%d\n", linenum);
+ break;
case 'p':
puts(line);
break;