> Date: Sat, 08 Nov 2014 21:54:27 +0100 (CET) > Cc: groff@gnu.org > From: Werner LEMBERG <w...@gnu.org> > > >> Any chance to have some code in `nonposix.h' to avoid this? > > > > Please suggest how. do_file more often than not accepts strings > > given by 'const char *', so it is not possible to modify the string > > itself. What else can I do? > > I was imagining something primitive, e.g. a working equivalent to > > #if defined(__MSDOS__) || (defined(_WIN32) && !defined(__CYGWIN__)) > # define DOS2UNIX_FILENAME(f) dos2unix_filename(f) > #else > # define DOS2UNIX_FILENAME(f) (f) > #endif
But then the non-Windows code will have to call strsave and strcpy unnecessarily, because we cannot modify 'const char *' strings. If that's okay with you, doing the above is easy; I was trying not to incur that overhead on Posix platforms.