* find/find.c (main): The default name of the program also doesn't need translation, so annotate that accordingly. (main): Likewise file open modes, debug strings and the name of the current directory. (specific_dirname): Mark the name of the current directory as not needing translation. (safely_chdir_lstat): Likewise. (wd_sanity_check): Likewise; also the name of the parent directory. (fs_likely_to_be_automounted): Mark file system names as not needing to be translated. (safely_chdir_lstat): Don't translate debug messages. (chdir_back): Likewise. (at_top): Mark "." and ".." as not needing to be translated. Similarly trivial format strings. (do_process_top_dir): Mark "." as not needing to be translated. (process_path): Mark debug strings as not needing to be translated. (process_dir): Mark ".", ".." and trivial format strings as not needing to be translated. --- ChangeLog | 21 ++++++++++++++++++++ find/find.c | 61 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 53 insertions(+), 29 deletions(-)
diff --git a/ChangeLog b/ChangeLog index df77b4a..dee336e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,26 @@ 2011-07-09 James Youngman <[email protected]> + Mark strings in find.c as not needing translation. + * find/find.c (main): The default name of the program also doesn't + need translation, so annotate that accordingly. + (main): Likewise file open modes, debug strings and the name of + the current directory. + (specific_dirname): Mark the name of the current directory as not + needing translation. + (safely_chdir_lstat): Likewise. + (wd_sanity_check): Likewise; also the name of the parent + directory. + (fs_likely_to_be_automounted): Mark file system names as not + needing to be translated. + (safely_chdir_lstat): Don't translate debug messages. + (chdir_back): Likewise. + (at_top): Mark "." and ".." as not needing to be translated. + Similarly trivial format strings. + (do_process_top_dir): Mark "." as not needing to be translated. + (process_path): Mark debug strings as not needing to be translated. + (process_dir): Mark ".", ".." and trivial format strings as not + needing to be translated. + Mark strings in ftsfind.c as not needing translation. * find/ftsfind.c (get_fts_info_name): Mark a debug message as not needing translation. diff --git a/find/find.c b/find/find.c index c34bd0e..045e35f 100644 --- a/find/find.c +++ b/find/find.c @@ -132,7 +132,7 @@ main (int argc, char **argv) if (argv[0]) set_program_name (argv[0]); else - set_program_name ("find"); + set_program_name (N_("find")); state.exit_status = 0; @@ -144,7 +144,7 @@ main (int argc, char **argv) record_initial_cwd (); state.already_issued_stat_error_msg = false; - state.shared_files = sharefile_init ("w"); + state.shared_files = sharefile_init (N_("w")); if (NULL == state.shared_files) { error (EXIT_FAILURE, errno, @@ -171,7 +171,7 @@ main (int argc, char **argv) options.xstat = debug_stat; #ifdef DEBUG - fprintf (stderr, "cur_day_start = %s", ctime (&options.cur_day_start)); + fprintf (stderr, N_("cur_day_start = %s"), ctime (&options.cur_day_start)); #endif /* DEBUG */ /* state.cwd_dir_fd has to be initialised before we call build_expression_tree () @@ -204,7 +204,7 @@ main (int argc, char **argv) set_stat_placeholders (&starting_stat_buf); - if ((*options.xstat) (".", &starting_stat_buf) != 0) + if ((*options.xstat) (N_("."), &starting_stat_buf) != 0) error (EXIT_FAILURE, errno, _("cannot stat current directory")); /* If no paths are given, default to ".". */ @@ -222,7 +222,7 @@ main (int argc, char **argv) * we get a coredump. The best example of this is if we say * "find -printf %H" (note, not "find . -printf %H"). */ - char defaultpath[2] = "."; + char defaultpath[2] = N_("."); process_top_path (defaultpath, 0); } @@ -248,7 +248,7 @@ specific_dirname (const char *dir) { char dirbuf[1024]; - if (0 == strcmp (".", dir)) + if (0 == strcmp (N_("."), dir)) { /* OK, what's '.'? */ if (NULL != getcwd (dirbuf, sizeof (dirbuf))) @@ -278,7 +278,10 @@ specific_dirname (const char *dir) static int fs_likely_to_be_automounted (const char *fs) { - return ( (0==strcmp (fs, "nfs")) || (0==strcmp (fs, "autofs")) || (0==strcmp (fs, "subfs"))); + return 0 + || (0==strcmp (fs, N_("nfs"))) + || (0==strcmp (fs, N_("autofs"))) + || (0==strcmp (fs, N_("subfs"))); } @@ -457,7 +460,7 @@ wd_sanity_check (const char *thing_to_stat, const char *fstype; char *specific_what = NULL; int silent = 0; - const char *current_dir = "."; + const char *current_dir = N_("."); *changed = false; @@ -493,7 +496,7 @@ wd_sanity_check (const char *thing_to_stat, error (EXIT_FAILURE, 0, _("%s%s changed during execution of %s (old device number %ld, new device number %ld, file system type is %s) [ref %ld]"), safely_quote_err_filename (0, specific_what), - parent ? "/.." : "", + parent ? N_("/..") : N_(""), safely_quote_err_filename (1, progname), (long) old_dev, (long) newinfo->st_dev, @@ -532,7 +535,7 @@ wd_sanity_check (const char *thing_to_stat, "(old inode number %" PRIuMAX ", new inode number %" PRIuMAX ", file system type is %s) [ref %ld]"), safely_quote_err_filename (0, specific_what), - parent ? "/.." : "", + parent ? N_("/..") : N_(""), safely_quote_err_filename (1, progname), (uintmax_t) old_ino, (uintmax_t) newinfo->st_ino, @@ -581,7 +584,7 @@ safely_chdir_lstat (const char *dest, saved_errno = errno = 0; - dotfd = open_cloexec (".", O_RDONLY + dotfd = open_cloexec (N_("."), O_RDONLY #if defined O_LARGEFILE |O_LARGEFILE #endif @@ -661,13 +664,13 @@ safely_chdir_lstat (const char *dest, #endif if (options.debug_options & DebugSearch) - fprintf (stderr, "safely_chdir(): chdir(\"%s\")\n", dest); + fprintf (stderr, N_("safely_chdir(): chdir(\"%s\")\n"), dest); if (0 == chdir (dest)) { /* check we ended up where we wanted to go */ bool changed = false; - if (!wd_sanity_check (".", program_name, ".", + if (!wd_sanity_check (N_("."), program_name, N_("."), statbuf_dest->st_dev, statbuf_dest->st_ino, &statbuf_arrived, @@ -915,7 +918,7 @@ static void chdir_back (void) { if (options.debug_options & DebugSearch) - fprintf (stderr, "chdir_back(): chdir to start point\n"); + fprintf (stderr, N_("chdir_back(): chdir to start point\n")); restore_cwd (initial_wd); } @@ -941,7 +944,7 @@ at_top (char *pathname, state.starting_path_length = strlen (pathname); if (0 == *base - || 0 == strcmp (parent_dir, ".")) + || 0 == strcmp (parent_dir, N_("."))) { dirchange = 0; base = pathname; @@ -954,7 +957,7 @@ at_top (char *pathname, bool did_stat = false; dirchange = 1; - if (0 == strcmp (base, "..")) + if (0 == strcmp (base, N_(".."))) direction = TraversingUp; else direction = TraversingDown; @@ -972,9 +975,9 @@ at_top (char *pathname, chdir_status = safely_chdir (parent_dir, direction, &st, SymlinkFollowOk, &did_stat); if (SafeChdirOK != chdir_status) { - const char *what = (SafeChdirFailWouldBeUnableToReturn == chdir_status) ? "." : parent_dir; + const char *what = (SafeChdirFailWouldBeUnableToReturn == chdir_status) ? N_(".") : parent_dir; if (errno) - error (0, errno, "%s", + error (0, errno, N_("%s"), safely_quote_err_filename (0, what)); else error (0, 0, _("Failed to safely change directory into %s"), @@ -1005,7 +1008,7 @@ static void do_process_top_dir (char *pathname, { (void) pstat; - process_path (pathname, base, false, ".", mode); + process_path (pathname, base, false, N_("."), mode); complete_pending_execdirs (); } @@ -1194,7 +1197,7 @@ process_path (char *pathname, char *name, bool leaf, char *parent, apply_predicate (pathname, &stat_buf, eval_tree); if (options.debug_options & DebugSearch) - fprintf (stderr, "pathname = %s, stop_at_current_level = %d\n", + fprintf (stderr, N_("pathname = %s, stop_at_current_level = %d\n"), pathname, state.stop_at_current_level); if (state.stop_at_current_level == false) @@ -1265,7 +1268,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, if (dirinfo == NULL) { assert (errno != 0); - error (0, errno, "%s", safely_quote_err_filename (0, pathname)); + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; } else @@ -1292,7 +1295,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, */ complete_pending_execdirs (); - if (strcmp (name, ".")) + if (strcmp (name, N_("."))) { enum SafeChdirStatus status = safely_chdir (name, TraversingDown, &stat_buf, SymlinkHandleDefault, &did_stat); switch (status) @@ -1315,7 +1318,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, * the direct call to stat() not through (options.xstat) */ set_stat_placeholders (&stat_buf); - if (0 != stat (".", &stat_buf)) + if (0 != stat (N_("."), &stat_buf)) break; /* skip the assignment. */ } dir_ids[dir_curr].dev = stat_buf.st_dev; @@ -1324,7 +1327,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, break; case SafeChdirFailWouldBeUnableToReturn: - error (0, errno, "."); + error (0, errno, N_(".")); state.exit_status = 1; break; @@ -1333,7 +1336,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, case SafeChdirFailStat: case SafeChdirFailNotDir: case SafeChdirFailChdirFailed: - error (0, errno, "%s", + error (0, errno, N_("%s"), safely_quote_err_filename (0, pathname)); state.exit_status = 1; return; @@ -1429,7 +1432,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, */ complete_pending_execdirs (); - if (strcmp (name, ".")) + if (strcmp (name, N_("."))) { enum SafeChdirStatus status; struct dir_id did; @@ -1440,7 +1443,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, bool deref = following_links () ? true : false; if ( (state.curdepth>0) && !deref) - dir = ".."; + dir = N_(".."); else { chdir_back (); @@ -1455,7 +1458,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, break; case SafeChdirFailWouldBeUnableToReturn: - error (EXIT_FAILURE, errno, "."); + error (EXIT_FAILURE, errno, N_(".")); return; case SafeChdirFailNonexistent: @@ -1465,7 +1468,7 @@ process_dir (char *pathname, char *name, int pathlen, const struct stat *statp, case SafeChdirFailNotDir: case SafeChdirFailChdirFailed: error (EXIT_FAILURE, errno, - "%s", safely_quote_err_filename (0, pathname)); + N_("%s"), safely_quote_err_filename (0, pathname)); return; } -- 1.7.2.5
