-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

[adding gnulib, as this problem is really a gnulib one, not a coreutils]

According to Martin Koeppe on 9/24/2007 5:46 PM:
> 
> On Mon, 24 Sep 2007, Paul Eggert wrote:
> 
>> Martin Koeppe <[EMAIL PROTECTED]> writes:
>>
>>> +      s = _("Unknown system error");
>>> +      fprintf (stderr, ": %s (errno=%d)", s, errnum);
>>
>> I like the idea, but that "errno=" grates a bit, as user diagnostics
>> shouldn't be so low-level.  How about this instead?
>>
>>  fprintf (stderr, _(": Unknown system error number %d"), errnum);
> 
> Ok, I could live with that. My idea was not to change the original
> string to avoid re-translation and to give a clear hint what this number
> is meant to be, i.e. that's an errno value. The number alone is probably
> of no use to any "normal" user anyway. (Though I first had only "(%d)"
> myself.)

The Austin group debated making the next version of POSIX required to
always return a non-NULL result for strerror (although for out-of-range
errors, there was no guarantee that the string had to be unique, as in
printing what the out-of-range value was).  However, I think that proposal
has stalled, so the Interix behavior of returning NULL for strerror(-1) is
not yet non-POSIX compliant.  I am very much in favor of a gnulib
implementation of strerror that works harder to provide non-NULL results.

> OTOH if strerror() cannot resolve the errno value, then there
> is probably a bigger problem in it, not a normally occuring case
> (generating a user level diagnostic has just failed!), and debugging
> should be made easy. I also think it's a good idea to have ":" and "%d"
> not within the string for easy and uniform translations.

Actually, gettext encourages putting %d in the translation, so that
languages that use pluralization rules in their translation can deal with
it better.  In other words, Paul's suggested wording is better.

For reference, here's what cygwin does with unknown errors:

"Unknown error %u"

without translation (but then again, cygwin lacks builtin translation).

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG+IJ284KuGfSFAYARAqfAAJ9qulY2G/MT6OaTYAIi0lxU/qFSuACZAZz0
H3Q0B0nThfZQHDJ5Zpywu0Y=
=Idym
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to