]> Dogcows Code - chaz/tar/blobdiff - src/misc.c
(exec_error, fork_error, dup_error,pipe_error): New functions
[chaz/tar] / src / misc.c
index 2cd98730ec752202f372605cc7199c5f58dec322..148d766c1dd00de8124142f11e2fbf8103a475ca 100644 (file)
@@ -17,8 +17,8 @@
    with this program; if not, write to the Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-#include "system.h"
-#include "rmt.h"
+#include <system.h>
+#include <rmt.h>
 #include "common.h"
 #include <quotearg.h>
 #include <save-cwd.h>
@@ -123,13 +123,13 @@ unquote_string (char *string)
          source++;
          break;
 
-       case 'n':
-         *destination++ = '\n';
+       case 'a':
+         *destination++ = '\a';
          source++;
          break;
-
-       case 't':
-         *destination++ = '\t';
+         
+       case 'b':
+         *destination++ = '\b';
          source++;
          break;
 
@@ -138,8 +138,8 @@ unquote_string (char *string)
          source++;
          break;
 
-       case 'b':
-         *destination++ = '\b';
+       case 'n':
+         *destination++ = '\n';
          source++;
          break;
 
@@ -148,6 +148,16 @@ unquote_string (char *string)
          source++;
          break;
 
+       case 't':
+         *destination++ = '\t';
+         source++;
+         break;
+
+       case 'v':
+         *destination++ = '\v';
+         source++;
+         break;
+         
        case '?':
          *destination++ = 0177;
          source++;
@@ -307,7 +317,8 @@ remove_any_file (const char *file_name, enum remove_option option)
                 entry += entrylen + 1)
              {
                char *file_name_buffer = new_name (file_name, entry);
-               int r = remove_any_file (file_name_buffer, 1);
+               int r = remove_any_file (file_name_buffer, 
+                                         RECURSIVE_REMOVE_OPTION);
                int e = errno;
                free (file_name_buffer);
 
@@ -538,6 +549,10 @@ static void
 call_arg_error (char const *call, char const *name)
 {
   int e = errno;
+  /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'.
+     Directly translating this to another language will not work, first because
+     %s itself is not translated.
+     Translate it as `%s: Function %s failed'. */
   ERROR ((0, e, _("%s: Cannot %s"), quotearg_colon (name), call));
 }
 
@@ -547,6 +562,10 @@ static void
 call_arg_fatal (char const *call, char const *name)
 {
   int e = errno;
+  /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'.
+     Directly translating this to another language will not work, first because
+     %s itself is not translated.
+     Translate it as `%s: Function %s failed'. */
   FATAL_ERROR ((0, e, _("%s: Cannot %s"), quotearg_colon (name),  call));
 }
 
@@ -556,6 +575,10 @@ static void
 call_arg_warn (char const *call, char const *name)
 {
   int e = errno;
+  /* TRANSLATORS: %s after `Cannot' is a function name, e.g. `Cannot open'.
+     Directly translating this to another language will not work, first because
+     %s itself is not translated.
+     Translate it as `%s: Function %s failed'. */
   WARN ((0, e, _("%s: Warning: Cannot %s"), quotearg_colon (name), call));
 }
 
@@ -636,6 +659,30 @@ mknod_error (char const *name)
   call_arg_error ("mknod", name);
 }
 
+void
+exec_error (char const *name)
+{
+  call_arg_error ("exec", name);
+}
+
+void
+fork_error (char const *name)
+{
+  call_arg_error ("fork", name);
+}
+
+void
+dup2_error (char const *name)
+{
+  call_arg_error ("dup2", name);
+}
+
+void
+pipe_error (char const *name)
+{
+  call_arg_error ("pipe", name);
+}
+
 void
 open_error (char const *name)
 {
@@ -675,8 +722,8 @@ read_error_details (char const *name, off_t offset, size_t size)
   char buf[UINTMAX_STRSIZE_BOUND];
   int e = errno;
   ERROR ((0, e,
-         ngettext ("%s: Read error at byte %s, reading %lu byte",
-                   "%s: Read error at byte %s, reading %lu bytes",
+         ngettext ("%s: Read error at byte %s, while reading %lu byte",
+                   "%s: Read error at byte %s, while reading %lu bytes",
                    size),
          quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
          (unsigned long) size));
@@ -688,8 +735,8 @@ read_warn_details (char const *name, off_t offset, size_t size)
   char buf[UINTMAX_STRSIZE_BOUND];
   int e = errno;
   WARN ((0, e,
-        ngettext ("%s: Warning: Read error at byte %s, reading %lu byte",
-                  "%s: Warning: Read error at byte %s, reading %lu bytes",
+        ngettext ("%s: Warning: Read error at byte %s, while reading %lu byte",
+                  "%s: Warning: Read error at byte %s, while reading %lu bytes",
                   size),
         quotearg_colon (name), STRINGIFY_BIGINT (offset, buf),
         (unsigned long) size));
@@ -814,6 +861,12 @@ symlink_error (char const *contents, char const *name)
          quotearg_colon (name), quote_n (1, contents)));
 }
 
+void
+stat_fatal (char const *name)
+{
+  call_arg_fatal ("stat", name);
+}
+
 void
 stat_error (char const *name)
 {
This page took 0.024505 seconds and 4 git commands to generate.