From b2da4b42344444dc22f1e5b01fb4cd09033adc1d Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 4 Feb 2007 03:24:32 +0000 Subject: * Added archive verification when loading package metadata for -u and -A operations (now aborts on a corrupt archive) * Fixed the pm_fprintf newline error that was plaguing us. It seems a line resetting 'neednl' was removed a while back (by me). This causes all the output errors we've been seeing --- src/pacman/add.c | 2 +- src/pacman/log.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/pacman/add.c b/src/pacman/add.c index 5137a8b9..6bed818b 100644 --- a/src/pacman/add.c +++ b/src/pacman/add.c @@ -77,7 +77,7 @@ int pacman_add(alpm_list_t *targets) for(i = targets; i; i = i->next) { if(alpm_trans_addtarget(i->data) == -1) { MSG(NL, "\n"); - ERR(NL, _("failed to add target '%s' (%s)\n"), (char *)i->data, alpm_strerror(pm_errno)); + ERR(NL, _("failed to add target '%s' (%s)"), (char *)i->data, alpm_strerror(pm_errno)); retval = 1; goto cleanup; } diff --git a/src/pacman/log.c b/src/pacman/log.c index ccdd9a66..4bed22ae 100644 --- a/src/pacman/log.c +++ b/src/pacman/log.c @@ -126,19 +126,19 @@ void pm_fprintf(FILE *file, unsigned short line, char *fmt, ...) } fprintf(file, str); + if(needpad == 1) { unsigned int i, cols = getcols(); for(i=len; i < cols; ++i) { fprintf(file, " "); } - if(neednl == 1) { + if(neednl == 1 && line == NL) { fprintf(file, "\n"); neednl = 0; - } else { - neednl = 1; } } fflush(file); + neednl = (str[strlen(str)-1] == '\n') ? 0 : 1; } /* Check verbosity option and, if set, print the -- cgit v1.2.3