X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fos_unix.C;h=e5ccd430d9959a1da95f7c3284a9f3edda60d274;hb=2c3ae20fc2ed8a1e9d8e46be5b20d3fc88b48dfc;hp=02da66050aa0a0bfc9a4c0418b29531ee06ee8e7;hpb=eeb1a304e261eb785d07594794a25bbcdbf0f286;p=lyx.git diff --git a/src/support/os_unix.C b/src/support/os_unix.C index 02da66050a..e5ccd430d9 100644 --- a/src/support/os_unix.C +++ b/src/support/os_unix.C @@ -23,7 +23,7 @@ void os::init(int * /*argc*/, char ** argv[]) /* :cp_(0), _shell(os::UNIX) */ { string tmp = *argv[0]; binname_ = OnlyFilename(tmp); tmp = ExpandPath(tmp); // This expands ./ and ~/ - if (!AbsolutePath(tmp)) { + if (!os::is_absolute_path(tmp)) { string binsearchpath = GetEnvPath("PATH"); // This will make "src/lyx" work always :-) binsearchpath += ";."; @@ -34,7 +34,7 @@ void os::init(int * /*argc*/, char ** argv[]) /* :cp_(0), _shell(os::UNIX) */ { // In case we are running in place and compiled with shared libraries if (suffixIs(tmp, "/.libs/")) - tmp.erase(tmp.length()-6, string::npos); + tmp.erase(tmp.length() - 6, string::npos); binpath_ = tmp; } @@ -64,10 +64,22 @@ string os::slashify_path(string p) { return p; } -string os::external_path(string p) { +string os::external_path(string const &p) { return p; } -string os::internal_path(string p) { +string os::internal_path(string const &p) { return p; } + +bool os::is_absolute_path(string const & p) +{ + return (!p.empty() && p[0] == '/'); +} + +// returns a string suitable to be passed to fopen/popen when +// reading a file +char const * os::read_mode() +{ + return "r"; +}