Bruno Haible <[EMAIL PROTECTED]> writes: > + /* First, look in the gnulib message catalog. */ > + const char *translated_pattern = _(english_pattern); > + if (translated_pattern == english_pattern) > + { > + /* The gnulib message catalog provides no translation. > + Try the system's message catalog. */ > + translated_pattern = nl_langinfo (nl_index); > + if (translated_pattern == NULL || translated_pattern[0] == '\0') > + /* Broken system. */ > + translated_pattern = english_pattern;
The overall idea seems sound, but shouldn't the code simply use the nl_langinfo result, if nl_langinfo exists and returns a nonempty string? That is, the above implementation would arguably cause 'mv' to not conform to POSIX, since (if I'm understanding things correctly) POSIX says that mv's behavior here depends on nl_langinfo's result and nothing else. On a POSIX-conforming host nl_langinfo must return a nonempty result for a valid locale, no? So if the code tries nl_langinfo first and uses its result, that will cause 'mv' to conform.