From 0a65de10b1cd8bd450e47e735cb909eec13822d0 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Thu, 10 Jan 2008 23:07:52 -0600 Subject: Output a single newline on receipt of a SIGINT Fixes FS#9147, where issuing a ctrl-C at a prompt puts the users prompt on the same line as our question. This can also occur during download bars. Although we might end up putting one too many newlines to the screen now, it is better than not putting one at all. Also update the copyright in pacman.c. Signed-off-by: Dan McGee --- src/pacman/pacman.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/pacman') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 4a948160..4171055a 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -1,7 +1,7 @@ /* * pacman.c * - * Copyright (c) 2002-2007 by Judd Vinet + * Copyright (c) 2002-2008 by Judd Vinet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -151,7 +151,7 @@ static void version(void) { printf("\n"); printf(" .--. Pacman v%s - libalpm v%s\n", PACKAGE_VERSION, LIB_VERSION); - printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2007 Judd Vinet \n"); + printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet \n"); printf("\\ '-. '-' '-' '-'\n"); printf(" '--'\n"); printf(_(" This program may be freely redistributed under\n" @@ -207,10 +207,11 @@ static void cleanup(int signum) if(alpm_trans_interrupt() == 0) { /* a transaction is being interrupted, don't exit pacman yet. */ return; - } else { - /* no commiting transaction, we can release it now and then exit pacman */ - alpm_trans_release(); } + /* no commiting transaction, we can release it now and then exit pacman */ + alpm_trans_release(); + /* output a newline to be sure we clear any line we may be on */ + printf("\n"); } /* free alpm library resources */ -- cgit v1.2.3-70-g09d2