22 dbg_cmd_edit(
char *psz_args)
26 if ((editor = (
char *) getenv (
"EDITOR")) == NULL)
29 if (!psz_args || 0==strlen(psz_args)) {
32 unsigned int cmd_size = strlen(editor) + strlen(p_floc->
filenm) + 20;
33 char *edit_cmd = calloc(1, cmd_size);
37 snprintf(edit_cmd, cmd_size,
38 "%s +%lu \"%s\"", editor, p_floc->
lineno, p_floc->
filenm);
39 printf(
_(
"Running %s\n"), edit_cmd);
40 rc = system (edit_cmd);
43 printf (
_(
"cannot get target file location\n"));
46 printf(
_(
"The \"edit\" command does not take an argument: %s\n"), psz_args);
52 dbg_cmd_edit_init(
unsigned int c)
54 short_command[c].func = &dbg_cmd_edit;
55 short_command[c].use =
_(
"edit");
void shell_rc_status(int rc)
const gmk_floc * get_current_floc(void)
debug_return_t
Definition: trace.h:32
#define _(msgid)
Definition: make.h:293
unsigned long lineno
Definition: gnuremake.h:26
Definition: gnuremake.h:23
const char * filenm
Definition: gnuremake.h:25