From: Greg Kroah-Hartman Date: Wed, 19 May 2010 18:45:44 +0000 (-0700) Subject: init the readline function after parsing the command line options X-Git-Url: https://git.toastfreeware.priv.at/gregoa/bti.git/commitdiff_plain/f5653af73ffd81c843fb3fc4b06b8cf4893cf232 init the readline function after parsing the command line options This lets us properly debug the readline function choice if we need to. Signed-off-by: Greg Kroah-Hartman --- diff --git a/bti.c b/bti.c index 0668ccd..345821a 100644 --- a/bti.c +++ b/bti.c @@ -234,7 +234,6 @@ static struct session *session_alloc(void) session = zalloc(sizeof(*session)); if (!session) return NULL; - session_readline_init(session); return session; } @@ -242,7 +241,6 @@ static void session_free(struct session *session) { if (!session) return; - session_readline_cleanup(session); free(session->password); free(session->account); free(session->tweet); @@ -1218,6 +1216,7 @@ int main(int argc, char *argv[], char *envp[]) } } + session_readline_init(session); /* * Show the version to make it easier to determine what * is going on here @@ -1303,6 +1302,7 @@ int main(int argc, char *argv[], char *envp[]) log_session(session, retval); exit: + session_readline_cleanup(session); session_free(session); return retval;; }