Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions builtins/common.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,7 +87,9 @@ builtin_error_prolog (void)
name = get_name_for_error ();
fprintf (stderr, "%s: ", name);

#ifndef INTERACTIVE_SHELL_PRINT_LINENO
if (interactive_shell == 0)
#endif
fprintf (stderr, _("line %d: "), executing_line_number ());

if (this_command_name && *this_command_name)
Expand Down
2 changes: 2 additions & 0 deletions config-bot.h
Original file line numberDiff line numberDiff line change
Expand Up@@ -194,3 +194,5 @@

/* If you don't want bash to provide a default mail file to check. */
/* #undef DEFAULT_MAIL_DIRECTORY */

#define INTERACTIVE_SHELL_PRINT_LINENO
6 changes: 6 additions & 0 deletions error.c
Original file line numberDiff line numberDiff line change
Expand Up@@ -77,7 +77,11 @@ error_prolog (int print_lineno)
int line;

ename = get_name_for_error ();
#ifdef INTERACTIVE_SHELL_PRINT_LINENO
line = print_lineno ? executing_line_number () : -1;
#else
line = (print_lineno && interactive_shell == 0) ? executing_line_number () : -1;
#endif

if (line > 0)
fprintf (stderr, "%s:%s%d: ", ename, gnu_error_format ? "" : _(" line "), line);
Expand All@@ -96,7 +100,9 @@ get_name_for_error (void)
#endif

name = (char *)NULL;
#ifndef INTERACTIVE_SHELL_PRINT_LINENO
if (interactive_shell == 0)
#endif
{
#if defined (ARRAY_VARS)
bash_source_v = find_variable ("BASH_SOURCE");
Expand Down