Guillem Jover 18 роки тому
батько
коміт
c7843e7d4a
4 змінених файлів з 18 додано та 9 видалено
  1. 9 0
      ChangeLog
  2. 2 1
      dpkg-deb/build.c
  3. 3 3
      src/help.c
  4. 4 5
      src/processarc.c

+ 9 - 0
ChangeLog

@@ -1,3 +1,12 @@
+2008-06-27  Guillem Jover  <guillem@debian.org>
+
+	* 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  <hertzog@debian.org>
 
 	* scripts/install-info.pl: Improve error message when the

+ 2 - 1
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",

+ 3 - 3
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) {

+ 4 - 5
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 */