"Hrvoje Niksic" <[EMAIL PROTECTED]> said: > Doesn't the host lookup code use herrmsg()?
I was thinking mostly of 'errno' in conjuction with connect(). > And anyway, aren't Winsock functions supposed to set errno? If they > don't, how does Wget report "connection refused", to name but one > example? Wget relies on errno/strerror pretty heavily, and if that > were non-functional in such an obvious way, I'm sure someone would > have complained by now. Winsock (with MingW/MSVC/Watcom/DMC) does *not* set errno. How Wget on Windows could say "connection refused" I don't know. Sure it wasn't a CygWin version that said that? > > But the problem is that sys_errlist[] always returns English texts, > > That's not true. strerror() is more than just an index into > sys_errlist -- don't be confused by what you see in cmpt.c, that's > just for ancient systems without strerror. In non-English locales > with translated error messages, Wget prints the translated ones. > Which is how it should be, really. MSVC's (and hence MingW''s) strerror() is that simple. MS seems to think some ANSI functions are deprecated; use the core API instead. E.g. I've never been able to get anything but localised time- formats from setlocale (LC_ALL,"norwegian"). It doesn't make any difference on strerror() (Yet I use Norwegian Win-XP). If you mean gettext should translate strerror() strings, how can it know what all the Win compilers will return? (Watcom/DMC doesn't link to MSCVRT.DLL as MSVC/MingW do so that would make 3 sets of lists). > I'd like to go the other way with consistency: use gettext in Windows > builds! Agree, but then few users are bothered with of gettext. The .po files also have a tendendcy to lag behind. The important thing is that Wget report a suitable error (not "Unknown error") when it can. Hence my proposed setting of 'errno' and 'win_strerror()' function. --gv
