summaryrefslogtreecommitdiff
path: root/Src/hist.c
AgeCommit message (Collapse)AuthorFilesLines
2004-05-20- Added functions to push and pop the current history list, allowingWayne Davison1-16/+135
functions to more easily switch to their own private history. - Changed the existing history push/pop code in savehistfile() (which uses a separate history buf to allow it to rewrite the on-disk version of the history file without disturbing the in-memory list).
2004-05-18Added a comment to resizehistents() to explain why the function isWayne Davison1-0/+2
weirder than expected at first glance.
2004-05-11Fix the potential for an infinite loop in lockhistfile() if theWayne Davison1-2/+4
link() calls fails for some other reason than EEXIST.
2003-10-29a la 19209: zcalloc -> zshcallocPeter Stephenson1-2/+2
2003-08-1118941: history wrong after parse error during alias expansionPeter Stephenson1-0/+2
2002-06-1417318: ${(z)...} added an extra space when the lexical analyser failed.Peter Stephenson1-0/+9
2002-03-24Added "savehistsiz" (for the new SAVEHIST special parameter), and used itWayne Davison1-5/+9
in place of getiparam("SAVEHIST").
2002-02-22In putoldhistentryontop(), ensure that we can't return with "next" set toWayne Davison1-2/+3
the value we just put on top.
2002-02-20Yet another fix for prepnexthistent().Wayne Davison1-1/+2
2002-02-18Fixed a just-introduced bug in prepnexthistent() when curline is inWayne Davison1-4/+5
the list.
2002-02-16When savehistfile() rewrites the history file, there was a potential forWayne Davison1-1/+2
losing the entire history file if we couldn't lock the file for reading (it timed out) but we could lock the file for write (and wrote nothing).
2002-02-16Optimized putoldhistentryontop() so that when resizehistents() calls itWayne Davison1-14/+24
repeatedly while HIST_EXPIRE_DUPS_FIRST is set, it doesn't re-scan the already-checked hist items (avoiding potentially slow operation).
2002-02-13Improved resizehistents() so that it honors HISTEXPIREDUPSFIRST.Wayne Davison1-25/+33
2002-02-0616577: don't return a single dot as the path head of a slash.Clint Adams1-1/+5
2001-10-26Improved readhistline() to reject binary data better. (16184)Wayne Davison1-15/+18
2001-10-15Fix HIST_NO_SPACE when INTERACTIVE_COMMENTS is set and we get aWayne Davison1-3/+3
comment.
2001-09-24Fix out-of-memory on corrupt history files.Bart Schaefer1-25/+35
2001-09-15With HIST_NO_STORE, don't ignore what looks like a history command ifWayne Davison1-5/+11
we're really going to call a user-defined shell function.
2001-09-13+ Changed addhistnum() to return firsthist()-1 or curhist+1 on error.Wayne Davison1-1/+3
+ Ignore the "r" command if HIST_NO_STORE is set.
2001-08-07When rewriting the history file, set histactive to 0 and restore itWayne Davison1-0/+5
when we're done. This prevents the loss of the file's last line when a signal causes us to rewrite it. Also restore the value of histsiz.
2001-06-28Have prepnexthistent() remove any HIST_TEMPSTORE entry that is present.Wayne Davison1-0/+4
2001-06-08Don't mark a HIST_TMPSTORE entry with HIST_OLD so that the HFILE_FASTWayne Davison1-1/+1
algorithm in savehistfile() will recheck this hist num later.
2001-05-19Don't merge a HIST_TMPSTORE entry with a previous "duplicate" line.Wayne Davison1-3/+4
Also, don't call addhistnode() on a HIST_TMPSTORE entry.
2001-05-15+ Changed histreduceblanks() to preserve spaces at the start of theWayne Davison1-14/+30
line when HISTIGNORESPACE is set. + Flag a history entry with HIST_TMPSTORE when should_ignore_line() returns true (instead of dropping it from the history immediately). + Get rid of old HIST_TMPSTORE entries when a new command is entered. + The hist-file-reading code now handles destroying a foreign duplicate (when marked as duplicate by addhistnode()).
2001-05-10Fixed an obscure local-history bug that could make the "history"Wayne Davison1-4/+3
command output something that was slightly wrong. (14304)
2001-04-20Parameter repairs, mostly for subscripting.Bart Schaefer1-1/+1
2001-04-10Slightly optimized should_ignore_line() by using getjobtext() ratherWayne Davison1-9/+3
than getpermtext().
2001-02-26properly restore noaliases in bufferwords() (13530)Sven Wischnowsky1-1/+2
2001-02-1913280: NewImproved handling of colon modifiers w.r.t. pathsPeter Stephenson1-24/+51
2001-01-16remove 13108 (trap queues); replace with signal queueing to ensure that user ↵Sven Wischnowsky1-6/+22
signal handlers are only executed when it is safe to run them (13365)
2000-10-21Fix "vared -h" in shell scripts.Bart Schaefer1-2/+7
2000-10-19Don't call histreduceblanks() if the line didn't parse right.Wayne Davison1-4/+5
2000-07-31isalpha() -> ialpha(); avoid a compiler warning (12439)Sven Wischnowsky1-1/+1
2000-07-20Renamed shouldIgnoreLine() to should_ignore_line().Wayne Davison1-2/+2
2000-07-20Support "builtin" in the HIST_NO_STORE check.Wayne Davison1-3/+6
2000-07-19Removed remhist() and HA_JUNKED, added an Eprog arg to hend(), andWayne Davison1-25/+47
added the shouldIgnoreLine() function that hend() now calls to figure out if it needs to save the line or not.
2000-07-18+ Got rid of the spaceflag variable.Wayne Davison1-11/+8
+ Make sure that the curline.histnum variable is accurate at the end of our history processing, even if we read in some foreign history and/or if we replaced the prior line because it was a duplicate of the current one. This enables the history (fc -l) command to work properly, even if the current command was HIST_NO_SPACE-ed away. + Don't allow remhist() to remove the last line in the history if we didn't store the current command.
2000-07-17Fix the gethistent() function and enhanced the reliability of theWayne Davison1-9/+14
SHARE_HISTORY option.
2000-07-16+ Needed to call unmeta() in a few spots that used the HISTFILE name.Wayne Davison1-20/+36
+ The non-HAVE_LINK code in lockhistfile() was broken in a number of ways. + Added an extra unlink() call to the HAVE_LINK code in lockhistfile() since (Linix at least says that) O_EXCL over NFS is broken.
2000-07-13condition parsing with (z) flagSven Wischnowsky1-0/+4
2000-07-13slightly improved (z) flag for parsing conditions; recognising glob flags in ↵Sven Wischnowsky1-6/+9
conditions still doesn't work (12237)
2000-07-12fix for (z) flag, don't take # as comment (12228)Sven Wischnowsky1-3/+4
2000-05-30AIX depenency fix (11661)Oliver Kiddle1-1/+1
2000-05-30Wayne: Fix two history bugs that were causing theBart Schaefer1-20/+19
failure of `print -s'.
2000-05-23save and restore more variables in bufferwords(); move gotword() into core ↵Sven Wischnowsky1-1/+6
(11523)
2000-05-05Wayne: fix for print -s when called from widget; added lines are not ↵Sven Wischnowsky1-25/+44
immediately available, though (11171)
2000-05-03fix for the (z) flag: report partial word (like `"foo', without a closing ↵Sven Wischnowsky1-0/+5
quote); mention in manual that (z) is handled lately (11117)
2000-05-03new (z) parameter flag to do shell-word splitting on the value (11113)Sven Wischnowsky1-3/+25
2000-04-12new widget copy-prev-shell-word, like copy-prev-word but uses shell parsing ↵Sven Wischnowsky1-292/+719
to find word (10685)
1999-04-15Initial revisionTanaka Akira1-0/+1670