Don't put lines starting with a space character in the history, to allow hiding password from history file.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@274 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
strk 2009-02-24 20:54:43 +00:00
parent 1c0efc71c6
commit 4f92fae1a1

View file

@ -946,9 +946,11 @@ linphonec_main_loop (LinphoneCore * opm, char * sipAddr)
#ifdef HAVE_READLINE
/*
* Only add to history if not already
* last item in it
* last item in it, and only if the command
* doesn't start with a space (to allow for
* hiding passwords)
*/
if ( strcmp(last_in_history, iptr) )
if ( iptr == input && strcmp(last_in_history, iptr) )
{
strncpy(last_in_history,iptr,sizeof(last_in_history));
last_in_history[sizeof(last_in_history)-1]='\0';