components/bash/patches/solaris-017.bashhist.c.patch
branchs11u3-sru
changeset 7627 4758b76d5ad5
parent 7623 d89b1c5817f5
child 7628 409696918882
equal deleted inserted replaced
7623:d89b1c5817f5 7627:4758b76d5ad5
     1 - in maybe_append_history, change check for history_lines_this_session
       
     2   so that we append the lines to the file if it's equal to the value
       
     3   returned by where_history(). This means that without this change,
       
     4   the history won't be appended if all the lines in the history list
       
     5   were added in the current session since the last time the history
       
     6   file was read or written. Fixes bug reported by Bruce Korb
       
     7   <[email protected]>
       
     8 
       
     9 http://lists.gnu.org/archive/html/bug-bash/2010-08/msg00101.html
       
    10 
       
    11 --- bashhist.c	2009-08-14 12:33:02.000000000 -0700
       
    12 +++ bashhist.c	2013-08-26 02:05:33.384872000 -0700
       
    13 @@ -372,7 +372,7 @@ maybe_append_history (filename)
       
    14    struct stat buf;
       
    15  
       
    16    result = EXECUTION_SUCCESS;
       
    17 -  if (history_lines_this_session && (history_lines_this_session < where_history ()))
       
    18 +  if (history_lines_this_session && (history_lines_this_session <= where_history ()))
       
    19      {
       
    20        /* If the filename was supplied, then create it if necessary. */
       
    21        if (stat (filename, &buf) == -1 && errno == ENOENT)