Summary: | ASTERISK-02146: [patch] Prevent blank lines from being saved in the history | ||
Reporter: | cursor_software (cursor_software) | Labels: | |
Date Opened: | 2004-07-29 22:32:19 | Date Closed: | 2008-01-15 15:04:18.000-0600 |
Priority: | Major | Regression? | No |
Status: | Closed/Complete | Components: | Core/General |
Versions: | Frequency of Occurrence | ||
Related Issues: | |||
Environment: | Attachments: | ( 0) asterisk.c.2.diff ( 1) asterisk.c.3.diff ( 2) asterisk.c.diff ( 3) asterisk.c.unidiff | |
Description: | The Asterisk history mechanism has an annoying tendency to insert blank lines into the history buffer, and save those blanks into the file. It also adds a new blank line, between every saved command, every time the console (or remote) mode is entered. These blanks accumulate and you end up with a lot of blank lines between each command after a while. ****** ADDITIONAL INFORMATION ****** To see the problems that this patch clears: 1. * Start asterisk in remote mode and quit. * Do this a few times. * Look at the history file to see the extra blank lines that are inserted every time. 2. * Type a command. * Type return a few times. * Type another command. * You now have blank lines in your history, so using the up navigation will present those blank lines as saved commands. | ||
Comments: | By: cursor_software (cursor_software) 2004-07-29 22:58:04 The second patch is related to the first. It prevents the last history line from being duplicated every time the history is loaded. By: cursor_software (cursor_software) 2004-07-29 23:06:02 Although asterisk.c.2.diff works, asterisk.c.3.diff is a better way of doing it. By: Brian West (bkw918) 2004-07-30 00:43:26 diff -u please :) By: cursor_software (cursor_software) 2004-07-31 19:42:25 Unidiff uploaded, as requested. The unidiff replaces all of the other diffs and changes the history mechanism as follows: 1. Don't save blank lines into the history. 2. Don't duplicate the last command when reading a saved history. By: Mark Spencer (markster) 2004-07-31 22:07:46 Do you already have a disclaimer on file? By: cursor_software (cursor_software) 2004-08-01 00:29:04 I don't have a disclaimer on file, no. By: Mark Spencer (markster) 2004-08-01 01:19:13 We will need one in order to merge your patch. Please see http://bugs.digium.com for a link to the disclaimers (either one will do). Thanks! By: cursor_software (cursor_software) 2004-08-01 04:46:57 I just spotted the line in the unidiff that looks like this: if (len < 1 || len > 256) That should obviously be changed to: if (len < 0 || len > 254) The "len" is one less than the actual string length by the time that code is reached. By: Mark Spencer (markster) 2004-08-01 14:27:33 Okay, since you don't have a disclaimer on file, I just went ahead and fixed it my own way not using your patch. Please go ahead and file a disclaimer before submitting any more patches, thanks! By: cursor_software (cursor_software) 2004-08-02 20:30:56 The patch you added to CVS doesn't resolve the whole issue. Blank lines are still added every time the ".asterisk_history" file is loaded. The blank lines accumulate with every open/close iteration. By: twisted (twisted) 2004-08-02 21:10:56 spoke with cursor on IRC, he stated he will be unable to file a disclaimer. I will leave this open for a few more days so that Markster can take note, and close it. By: Mark Spencer (markster) 2004-08-03 02:52:15 Yah i don't think that's very critical but i went ahead and fixed that too. Twisted: We need to be sure to delete any patches by cursor_software in the bug tracker to make sure they don't inadvertantly find their way into Asterisk since he will be unable to file a disclaimer. By: Digium Subversion (svnbot) 2008-01-15 15:04:18.000-0600 Repository: asterisk Revision: 3561 U trunk/asterisk.c ------------------------------------------------------------------------ r3561 | markster | 2008-01-15 15:04:17 -0600 (Tue, 15 Jan 2008) | 2 lines Don't record empty lines (bug ASTERISK-2146, but not using proposed patch) ------------------------------------------------------------------------ http://svn.digium.com/view/asterisk?view=rev&revision=3561 |