summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-01-10 23:07:52 -0600
committerDan McGee <dan@archlinux.org>2008-01-10 23:07:52 -0600
commit0a65de10b1cd8bd450e47e735cb909eec13822d0 (patch)
tree262a1e14fecbe7f0786c52398e5bb1c6e7c3146d /src
parent887ad59eb68fbbda4ad50a7f073448fd7fe28f99 (diff)
downloadpacman-0a65de10b1cd8bd450e47e735cb909eec13822d0.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c11
1 files changed, 6 insertions, 5 deletions
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 <jvinet@zeroflux.org>
+ * Copyright (c) 2002-2008 by Judd Vinet <jvinet@zeroflux.org>
*
* 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 <jvinet@zeroflux.org>\n");
+ printf("/ _.-' .-. .-. .-. Copyright (C) 2002-2008 Judd Vinet <jvinet@zeroflux.org>\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 */