X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=builtins%2Fhistory.def;h=b1e3ab391d643f1c2e678a0743ccc6708db5ff80;hb=d166f048818e10cf3799aa24a174fb22835f1acc;hp=939eb253b787573d1ded13b42b08299fccc988df;hpb=ccc6cda312fea9f0468ee65b8f368e9653e1380b;p=platform%2Fupstream%2Fbash.git diff --git a/builtins/history.def b/builtins/history.def index 939eb25..b1e3ab3 100644 --- a/builtins/history.def +++ b/builtins/history.def @@ -45,7 +45,7 @@ $END #include #if defined (HISTORY) -#include +#include "../bashtypes.h" #include #include "../posixstat.h" #include "../filecntl.h" @@ -193,7 +193,7 @@ display_history (list) if (list) { limited = 1; - limit = get_numeric_arg (list); + limit = get_numeric_arg (list, 0); } else limited = limit = 0; @@ -259,7 +259,7 @@ push_history (list) { char *s; - if (delete_last_history () == 0) + if (hist_last_line_added && delete_last_history () == 0) return; s = string_list (list); maybe_add_history (s); /* Obeys HISTCONTROL setting. */ @@ -274,7 +274,7 @@ expand_and_print_history (list) char *s; int r, result; - if (delete_last_history () == 0) + if (hist_last_line_added && delete_last_history () == 0) return EXECUTION_FAILURE; result = EXECUTION_SUCCESS; while (list)