diff options
author | Chet Ramey <chet.ramey@case.edu> | 2011-11-23 19:20:49 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2011-11-23 19:20:49 -0500 |
commit | 8e82c61d4caacfd43668bf1d2a7e23a0a21fa5bc (patch) | |
tree | d159ca5b29e675050fceebaea28437233f09396d /history.c | |
parent | 518937ab89be812ccd45e9b8c1ce4ad721d35ef6 (diff) | |
download | readline-8e82c61d4caacfd43668bf1d2a7e23a0a21fa5bc.tar.gz |
Readline-6.0 import
Diffstat (limited to 'history.c')
-rw-r--r-- | history.c | 31 |
1 files changed, 16 insertions, 15 deletions
@@ -1,24 +1,23 @@ /* history.c -- standalone history library */ -/* Copyright (C) 1989-2005 Free Software Foundation, Inc. +/* Copyright (C) 1989-2009 Free Software Foundation, Inc. - This file contains the GNU History Library (the Library), a set of + This file contains the GNU History Library (History), a set of routines for managing the text of previously typed lines. - The Library is free software; you can redistribute it and/or modify + History is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - The Library is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - General Public License for more details. + History is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - The GNU General Public License is often shipped with GNU software, and - is generally kept in a file called COPYING or LICENSE. If you do not - have a copy of the license, write to the Free Software Foundation, - 59 Temple Place, Suite 330, Boston, MA 02111 USA. */ + You should have received a copy of the GNU General Public License + along with History. If not, see <http://www.gnu.org/licenses/>. +*/ /* The goal is to make the implementation transparent, so that you don't have to know what data types are used, just what functions @@ -158,7 +157,7 @@ history_set_pos (pos) return (1); } -/* Return the current history array. The caller has to be carefull, since this +/* Return the current history array. The caller has to be careful, since this is the actual array of data, and could be bashed or made corrupt easily. The array is terminated with a NULL pointer. */ HIST_ENTRY ** @@ -319,6 +318,8 @@ add_history_time (string) { HIST_ENTRY *hs; + if (string == 0) + return; hs = the_history[history_length - 1]; FREE (hs->timestamp); hs->timestamp = savestring (string); @@ -483,7 +484,7 @@ stifle_history (max) /* Stop stifling the history. This returns the previous maximum number of history entries. The value is positive if the history - was stifled, negative if it wasn't. */ + was stifled, negative if it wasn't. */ int unstifle_history () { |