diff options
Diffstat (limited to 'src/tac.c')
-rw-r--r-- | src/tac.c | 27 |
1 files changed, 13 insertions, 14 deletions
@@ -45,7 +45,6 @@ tac -r -s '.\| #include "error.h" #include "filenamecat.h" -#include "quote.h" #include "safe-read.h" #include "stdlib--.h" #include "xfreopen.h" @@ -220,7 +219,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos) { file_pos -= remainder; if (lseek (input_fd, file_pos, SEEK_SET) < 0) - error (0, errno, _("%s: seek failed"), quote (file)); + error (0, errno, _("%s: seek failed"), quotef (file)); } /* Scan backward, looking for end of file. This caters to proc-like @@ -230,7 +229,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos) { off_t rsize = read_size; if (lseek (input_fd, -rsize, SEEK_CUR) < 0) - error (0, errno, _("%s: seek failed"), quote (file)); + error (0, errno, _("%s: seek failed"), quotef (file)); file_pos -= read_size; } @@ -248,7 +247,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos) if (saved_record_size == SAFE_READ_ERROR) { - error (0, errno, _("%s: read error"), quote (file)); + error (0, errno, _("%s: read error"), quotef (file)); return false; } @@ -340,7 +339,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos) file_pos = 0; } if (lseek (input_fd, file_pos, SEEK_SET) < 0) - error (0, errno, _("%s: seek failed"), quote (file)); + error (0, errno, _("%s: seek failed"), quotef (file)); /* Shift the pending record data right to make room for the new. The source and destination regions probably overlap. */ @@ -354,7 +353,7 @@ tac_seekable (int input_fd, const char *file, off_t file_pos) if (safe_read (input_fd, G_buffer, read_size) != read_size) { - error (0, errno, _("%s: read error"), quote (file)); + error (0, errno, _("%s: read error"), quotef (file)); return false; } } @@ -456,7 +455,7 @@ temp_stream (FILE **fp, char **file_name) if (fd < 0) { error (0, errno, _("failed to create temporary file in %s"), - quote (tempdir)); + quoteaf (tempdir)); goto Reset; } @@ -464,7 +463,7 @@ temp_stream (FILE **fp, char **file_name) if (! tmp_fp) { error (0, errno, _("failed to open %s for writing"), - quote (tempfile)); + quoteaf (tempfile)); close (fd); unlink (tempfile); Reset: @@ -481,7 +480,7 @@ temp_stream (FILE **fp, char **file_name) || ftruncate (fileno (tmp_fp), 0) < 0) { error (0, errno, _("failed to rewind stream for %s"), - quote (tempfile)); + quoteaf (tempfile)); return false; } } @@ -511,13 +510,13 @@ copy_to_temp (FILE **g_tmp, char **g_tempfile, int input_fd, char const *file) break; if (bytes_read == SAFE_READ_ERROR) { - error (0, errno, _("%s: read error"), quote (file)); + error (0, errno, _("%s: read error"), quotef (file)); goto Fail; } if (fwrite (G_buffer, 1, bytes_read, fp) != bytes_read) { - error (0, errno, _("%s: write error"), quote (file_name)); + error (0, errno, _("%s: write error"), quotef (file_name)); goto Fail; } @@ -529,7 +528,7 @@ copy_to_temp (FILE **g_tmp, char **g_tempfile, int input_fd, char const *file) if (fflush (fp) != 0) { - error (0, errno, _("%s: write error"), quote (file_name)); + error (0, errno, _("%s: write error"), quotef (file_name)); goto Fail; } @@ -584,7 +583,7 @@ tac_file (const char *filename) if (fd < 0) { error (0, errno, _("failed to open %s for reading"), - quote (filename)); + quoteaf (filename)); return false; } } @@ -597,7 +596,7 @@ tac_file (const char *filename) if (!is_stdin && close (fd) != 0) { - error (0, errno, _("%s: read error"), quote (filename)); + error (0, errno, _("%s: read error"), quotef (filename)); ok = false; } return ok; |