diff options
author | Dan McGee <dan@archlinux.org> | 2007-02-12 16:39:29 +0100 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2007-02-12 16:39:29 +0100 |
commit | 8cb0758beb5f24ffc827925bbbc3841ca511dc86 (patch) | |
tree | 1ee2618cfe94f3fce138e7309f2af53e5ba86842 /src/pacman/package.c | |
parent | 2977764aa55c98a3a637b7e4147d378042450caf (diff) | |
download | pacman-8cb0758beb5f24ffc827925bbbc3841ca511dc86.tar.gz pacman-8cb0758beb5f24ffc827925bbbc3841ca511dc86.tar.xz |
* Fixed an i18n bug; length of description string was hardcoded previously;
now uses an strlen call.
* Updates of the *.pot files.
Diffstat (limited to 'src/pacman/package.c')
-rw-r--r-- | src/pacman/package.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/pacman/package.c b/src/pacman/package.c index 2e037a55..145e5bbe 100644 --- a/src/pacman/package.c +++ b/src/pacman/package.c @@ -41,7 +41,7 @@ */ void dump_pkg_full(pmpkg_t *pkg, int level) { - const char *bdate, *type, *idate, *reason; + const char *bdate, *type, *idate, *reason, *descheader; if(pkg == NULL) { return; @@ -64,6 +64,8 @@ void dump_pkg_full(pmpkg_t *pkg, int level) break; } + descheader = _("Description : "); + /* actual output */ printf(_("Name : %s\n"), (char *)alpm_pkg_get_name(pkg)); printf(_("Version : %s\n"), (char *)alpm_pkg_get_version(pkg)); @@ -90,8 +92,9 @@ void dump_pkg_full(pmpkg_t *pkg, int level) printf(_("Install Script : %s\n"), alpm_pkg_has_scriptlet(pkg) ? _("Yes") : _("No")); - printf(_("Description : ")); - indentprint(alpm_pkg_get_desc(pkg), 17); + /* printed using a variable to make i18n safe */ + printf("%s", descheader); + indentprint(alpm_pkg_get_desc(pkg), strlen(descheader)); printf("\n"); /* Print additional package info if info flag passed more than once */ @@ -107,11 +110,13 @@ void dump_pkg_full(pmpkg_t *pkg, int level) */ void dump_pkg_sync(pmpkg_t *pkg, const char *treename) { - char *md5sum, *sha1sum; + char *descheader, *md5sum, *sha1sum; if(pkg == NULL) { return; } + descheader = _("Description : "); + md5sum = (char *)alpm_pkg_get_md5sum(pkg); sha1sum = (char *)alpm_pkg_get_sha1sum(pkg); @@ -127,8 +132,9 @@ void dump_pkg_sync(pmpkg_t *pkg, const char *treename) printf(_("Download Size : %6.2f K\n"), (float)alpm_pkg_get_size(pkg) / 1024.0); printf(_("Installed Size : %6.2f K\n"), (float)alpm_pkg_get_isize(pkg) / 1024.0); - printf(_("Description : ")); - indentprint(alpm_pkg_get_desc(pkg), 17); + /* printed using a variable to make i18n safe */ + printf("%s", descheader); + indentprint(alpm_pkg_get_desc(pkg), strlen(descheader)); printf("\n"); if (md5sum != NULL && md5sum[0] != '\0') { |