summaryrefslogtreecommitdiff
path: root/src/pacman/package.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-02-24 01:22:07 -0600
committerDan McGee <dan@archlinux.org>2008-02-24 01:22:07 -0600
commit3ad3077d8d5bb0d67652d0045e3e5eaf4eef6ffb (patch)
tree6b968cc50ea7395b02c043022da292732196339b /src/pacman/package.c
parent3a6f62d4c711d2e05821094d02d7aca290cf15f9 (diff)
parent96f7613d15e46131bf8a4b93828ad70b041524d1 (diff)
Merge branch 'maint'
Conflicts: src/pacman/callback.c
Diffstat (limited to 'src/pacman/package.c')
-rw-r--r--src/pacman/package.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c
index cc4be139..7019e7e6 100644
--- a/src/pacman/package.c
+++ b/src/pacman/package.c
@@ -24,6 +24,7 @@
#include <string.h>
#include <limits.h>
#include <sys/stat.h>
+#include <wchar.h>
#include <alpm.h>
#include <alpm_list.h>
@@ -48,6 +49,8 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
char bdatestr[50] = "", idatestr[50] = "";
const alpm_list_t *i;
alpm_list_t *requiredby = NULL, *depstrings = NULL;
+ wchar_t *wcstr;
+ int len;
if(pkg == NULL) {
return;
@@ -86,8 +89,6 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
requiredby = alpm_pkg_compute_requiredby(pkg);
}
- descheader = _("Description : ");
-
/* actual output */
if(level == 0) {
string_display(_("Filename :"), alpm_pkg_get_filename(pkg));
@@ -136,8 +137,16 @@ void dump_pkg_full(pmpkg_t *pkg, int level)
}
/* printed using a variable to make i18n safe */
+ descheader = _("Description : ");
+ /* len goes from # bytes -> # chars -> # cols */
+ len = strlen(descheader) + 1;
+ wcstr = calloc(len, sizeof(wchar_t));
+ len = mbstowcs(wcstr, descheader, len);
+ len = wcswidth(wcstr, len);
+ free(wcstr);
+ /* we can finally print the darn thing */
printf("%s", descheader);
- indentprint(alpm_pkg_get_desc(pkg), mbstowcs(NULL, descheader, 0));
+ indentprint(alpm_pkg_get_desc(pkg), len);
printf("\n\n");
/* Print additional package info if info flag passed more than once */