diff --git a/builtins/fc.def b/builtins/fc.def index c266ac2c..7f606c52 100644 --- a/builtins/fc.def +++ b/builtins/fc.def @@ -321,10 +321,7 @@ fc_builtin (list) while (last_hist >= 0 && hlist[last_hist] == 0) last_hist--; if (last_hist < 0) - { - sh_erange ((char *)NULL, _("history specification")); - return (EXECUTION_FAILURE); - } + last_hist = 0; if (list) { @@ -353,12 +350,10 @@ fc_builtin (list) histbeg = histend = last_hist; } - /* We print error messages for line specifications out of range. */ - if ((histbeg < 0) || (histend < 0)) - { - sh_erange ((char *)NULL, _("history specification")); - return (EXECUTION_FAILURE); - } + if (histbeg < 0) + histbeg = 0; + if (histend < 0) + histend = 0; /* "When not listing, the fc command that caused the editing shall not be entered into the history list." */ @@ -382,12 +377,10 @@ fc_builtin (list) histbeg = last_hist; } - /* We print error messages for line specifications out of range. */ - if ((histbeg < 0) || (histend < 0)) - { - sh_erange ((char *)NULL, _("history specification")); - return (EXECUTION_FAILURE); - } + if (histbeg < 0) + histbeg = 0; + if (histend < 0) + histend = 0; if (histend < histbeg) {