From 4f92fae1a1bb8bc726ac55f83de900cbd721ef72 Mon Sep 17 00:00:00 2001 From: strk Date: Tue, 24 Feb 2009 20:54:43 +0000 Subject: [PATCH] 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 --- linphone/console/linphonec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/linphone/console/linphonec.c b/linphone/console/linphonec.c index 5fbed08df..6985b6a3d 100644 --- a/linphone/console/linphonec.c +++ b/linphone/console/linphonec.c @@ -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';