From c7843e7d4a95bdf200bdf513332a04acf0ad93c5 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Fri, 27 Jun 2008 07:04:19 +0300 Subject: [PATCH] Fix localized strings --- ChangeLog | 9 +++++++++ dpkg-deb/build.c | 3 ++- src/help.c | 6 +++--- src/processarc.c | 9 ++++----- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 93ab79c1..ee566b12 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-27 Guillem Jover + + * dpkg-deb/build.c (do_build): Move string translation markers outside + of the string. + * src/help.c (ensure_pathname_nonexisting): Localize the 'failed' + variable instead of expecting gettext to magically infer the formatted + string. + * src/processarc.c (process_archive): Likewise. + 2008-06-27 Raphael Hertzog * scripts/install-info.pl: Improve error message when the diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index e458ab46..2650ab34 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -490,7 +490,8 @@ void do_build(const char *const *argv) { default: ohshit(_("Internal error, compress_type `%i' unknown!"), compress_type); } - if (fstat(gzfd,&datastab)) ohshite("_(failed to fstat tmpfile (data))"); + if (fstat(gzfd, &datastab)) + ohshite(_("failed to fstat tmpfile (data)")); if (fprintf(ar, "%s" "%s" "%-12lu0 0 100644 %-10ld`\n", diff --git a/src/help.c b/src/help.c index b7b21213..6ea81d4c 100644 --- a/src/help.c +++ b/src/help.c @@ -527,9 +527,9 @@ void ensure_pathname_nonexisting(const char *pathname) { if (errno == ENOTDIR) return; } if (errno != ENOTEMPTY && errno != EEXIST) { /* Huh ? */ - char mbuf[250]; - snprintf(mbuf, sizeof(mbuf), N_("failed to %s `%%.255s'"), failed); - ohshite(_(mbuf),pathname); + const char *failed_local = gettext(failed); + + ohshite(_("failed to %s '%.255s'"), failed_local, pathname); } c1= m_fork(); if (!c1) { diff --git a/src/processarc.c b/src/processarc.c index 3085962e..c93d12ee 100644 --- a/src/processarc.c +++ b/src/processarc.c @@ -739,11 +739,10 @@ void process_archive(const char *filename) { failed= N_("delete"); if (chmodsafe_unlink_statted(fnamevb.buf, &oldfs, &failed)) { - char mbuf[250]; - snprintf(mbuf, sizeof(mbuf), - N_("dpkg: warning - unable to %s old file `%%.250s': %%s\n"), - failed); - fprintf(stderr, _(mbuf), namenode->name, strerror(errno)); + const char *failed_local = gettext(failed); + + fprintf(stderr, _("dpkg: warning - unable to %s old file '%.250s': %s\n"), + failed_local, namenode->name, strerror(errno)); } } /* !S_ISDIR */ -- 2.39.5