On Mon, Sep 16, 2002 at 11:46:24PM -0700, Kayvan A. Sylvan wrote: > This fixes the problem with lyx2lyx on Cygwin. >
Has this patch been put in yet? It is clearly a bug-fix and not a new feature. -- Kayvan A. Sylvan | Proud husband of | Father to my kids: Sylvan Associates, Inc. | Laura Isabella Sylvan | Katherine Yelena (8/8/89) http://sylvan.com/~kayvan | "crown of her husband" | Robin Gregory (2/28/92)
Index: src/support/ChangeLog =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/ChangeLog,v retrieving revision 1.136 diff -u -r1.136 ChangeLog --- src/support/ChangeLog 2002/08/20 20:43:10 1.136 +++ src/support/ChangeLog 2002/09/17 06:39:26 @@ -1,3 +1,13 @@ +2002-09-16 Kayvan A. Sylvan <[EMAIL PROTECTED]> + + * os.h, os_os2.C, os_win32.C, os_unix.C: Added popen_read_mode(), + since at least for Cygwin, the "rb" read_mode acceptable for + fopen() is illegal for popen(), whose mode argument *must* be "r" + or "w". + + * filetools.C (RunCommand): Uses os::popen_read_mode() instead + of os::read_mode() + 2002-08-20 Lars Gullik Bjønnes <[EMAIL PROTECTED]> * Makefile.am (libsupport_la_SOURCES): delete smart_ptr.h and Index: src/support/filetools.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/filetools.C,v retrieving revision 1.134 diff -u -r1.134 filetools.C --- src/support/filetools.C 2002/07/28 22:50:13 1.134 +++ src/support/filetools.C 2002/09/17 06:39:26 @@ -1294,7 +1294,7 @@ // pstream (process stream), with the // variants ipstream, opstream - FILE * inf = ::popen(cmd.c_str(), os::read_mode()); + FILE * inf = ::popen(cmd.c_str(), os::popen_read_mode()); // (Claus Hentschel) Check if popen was succesful ;-) if (!inf) Index: src/support/os.h =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/os.h,v retrieving revision 1.6 diff -u -r1.6 os.h --- src/support/os.h 2002/03/21 17:06:35 1.6 +++ src/support/os.h 2002/09/17 06:39:26 @@ -52,9 +52,11 @@ static string internal_path(string const &p); // is path absolute? static bool is_absolute_path(string const & p); - // returns a string suitable to be passed to fopen/popen when + // returns a string suitable to be passed to fopen when // reading a file static char const * read_mode(); + // same for popen(). + static char const * popen_read_mode(); // static void warn(string mesg); private: Index: src/support/os_os2.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/os_os2.C,v retrieving revision 1.4 diff -u -r1.4 os_os2.C --- src/support/os_os2.C 2002/02/08 14:32:17 1.4 +++ src/support/os_os2.C 2002/09/17 06:39:26 @@ -174,9 +174,16 @@ } -// returns a string suitable to be passed to fopen/popen when +// returns a string suitable to be passed to fopen when // reading a file char const * os::read_mode() +{ + return "r"; +} + +// returns a string suitable to be passed to popen when +// reading a pipe +char const * os::popen_read_mode() { return "r"; } Index: src/support/os_unix.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/os_unix.C,v retrieving revision 1.5 diff -u -r1.5 os_unix.C --- src/support/os_unix.C 2002/02/08 14:32:17 1.5 +++ src/support/os_unix.C 2002/09/17 06:39:27 @@ -77,9 +77,16 @@ return (!p.empty() && p[0] == '/'); } -// returns a string suitable to be passed to fopen/popen when +// returns a string suitable to be passed to fopen when // reading a file char const * os::read_mode() +{ + return "r"; +} + +// returns a string suitable to be passed to popen when +// reading a pipe +char const * os::popen_read_mode() { return "r"; } Index: src/support/os_win32.C =================================================================== RCS file: /cvs/lyx/lyx-devel/src/support/os_win32.C,v retrieving revision 1.6 diff -u -r1.6 os_win32.C --- src/support/os_win32.C 2002/02/11 10:07:28 1.6 +++ src/support/os_win32.C 2002/09/17 06:39:27 @@ -119,9 +119,16 @@ return isDosPath | isUnixPath; } -// returns a string suitable to be passed to fopen/popen when +// returns a string suitable to be passed to fopen when // reading a file char const * os::read_mode() { return "rb"; +} + +// returns a string suitable to be passed to popen when +// reading a pipe +char const * os::popen_read_mode() +{ + return "r"; }