fix do_popen for cygwin

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3510 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2002-02-08 11:23:58 +00:00
parent 21245ae533
commit c42c666fdc
2 changed files with 19 additions and 3 deletions

View File

@ -1,10 +1,15 @@
2002-02-08 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
* filetools.C (do_popen): fix for cygwin compatibility (from Claus
Hentschel). This code should maybe be moved to os:: class.
2002-02-08 Herbert Voss <voss@perce.de> 2002-02-08 Herbert Voss <voss@perce.de>
* filetools.[C]: (unzipFile) fix typo * filetools.C: (unzipFile) fix typo
2002-02-06 Herbert Voss <voss@perce.de> 2002-02-06 Herbert Voss <voss@perce.de>
* filetools.[Ch]: fix sume bugs for detecting zipped files * filetools.[Ch]: fix some bugs for detecting zipped files
adding unzipFile() adding unzipFile()
2002-02-04 Herbert Voss <voss@perce.de> 2002-02-04 Herbert Voss <voss@perce.de>

View File

@ -1134,7 +1134,18 @@ cmdret const do_popen(string const & cmd)
// of course the best would be to have a // of course the best would be to have a
// pstream (process stream), with the // pstream (process stream), with the
// variants ipstream, opstream // variants ipstream, opstream
// CYGWIN needs 'b', but linux only works without it
#ifdef __CYGWIN__
FILE * inf = ::popen(cmd.c_str(), "rb");
#else
FILE * inf = ::popen(cmd.c_str(), "r"); FILE * inf = ::popen(cmd.c_str(), "r");
#endif
// (Claus Hentschel) Check if popen was succesful ;-)
if (!inf)
return make_pair(-1, string());
string ret; string ret;
int c = fgetc(inf); int c = fgetc(inf);
while (c != EOF) { while (c != EOF) {