X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fos_unix.C;h=e5ccd430d9959a1da95f7c3284a9f3edda60d274;hb=2c3ae20fc2ed8a1e9d8e46be5b20d3fc88b48dfc;hp=fd02ab9934db1602a55e1827ed9706f0f6e6f340;hpb=cdcb9b2cc09bed252d5247d89602bbef698a1487;p=lyx.git diff --git a/src/support/os_unix.C b/src/support/os_unix.C index fd02ab9934..e5ccd430d9 100644 --- a/src/support/os_unix.C +++ b/src/support/os_unix.C @@ -5,6 +5,7 @@ #include "os.h" #include "support/filetools.h" +#include "support/lstrings.h" string os::binpath_ = string(); string os::binname_ = string(); @@ -22,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 += ";."; @@ -33,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; } @@ -63,7 +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 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"; +}