>> 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.
Well, `do_file' is the function called in the top-level loop, called once per file, thus the overhead is very small – and the slight degradation of efficiency in `table.cpp' is OK with me. I suggest to use a `string' object for the filename string so that we have automatic deallocation; dos2unix_file can then use a `string &' parameter to get a slight C++ touch :-) Werner