mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
cygwin/popen fix from kayvan
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5331 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
a610cde867
commit
72956b1c3b
@ -1,3 +1,13 @@
|
||||
2002-09-16 Kayvan A. Sylvan <kayvan@sylvan.com>
|
||||
|
||||
* 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 <larsbj@birdstep.com>
|
||||
|
||||
* Makefile.am (libsupport_la_SOURCES): delete smart_ptr.h and
|
||||
|
@ -1294,7 +1294,7 @@ cmd_ret const RunCommand(string const & cmd)
|
||||
// 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)
|
||||
|
@ -52,9 +52,11 @@ public:
|
||||
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:
|
||||
|
@ -174,9 +174,16 @@ bool os::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
|
||||
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";
|
||||
}
|
||||
|
@ -77,9 +77,16 @@ bool os::is_absolute_path(string const & p)
|
||||
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";
|
||||
}
|
||||
|
@ -119,9 +119,16 @@ bool os::is_absolute_path(string const & p)
|
||||
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";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user