X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2Fos_unix.C;h=28235773133e77f33720950e0d7e651b420f485f;hb=342cdf432246110db37bee4e0aebb4b72c933ddb;hp=1d13cd50861e4700bf102e1e819e35a9be269dd9;hpb=4b7891d873ee690d7db3cc2d64476ac3eef7f263;p=lyx.git diff --git a/src/support/os_unix.C b/src/support/os_unix.C index 1d13cd5086..2823577313 100644 --- a/src/support/os_unix.C +++ b/src/support/os_unix.C @@ -13,61 +13,16 @@ #include #include "support/os.h" -#include "support/filetools.h" -#include "support/lstrings.h" - using std::string; -namespace { - -string binpath_; -string binname_; -string tmpdir_; -string homepath_; -string nulldev_; - -} - namespace lyx { namespace support { namespace os { -void init(int /*argc*/, char * argv[]) -{ - static bool initialized = false; - if (initialized) - return; - initialized = true; - - string tmp = argv[0]; - binname_ = OnlyFilename(tmp); - tmp = ExpandPath(tmp); // This expands ./ and ~/ - if (!is_absolute_path(tmp)) { - string binsearchpath = GetEnvPath("PATH"); - // This will make "src/lyx" work always :-) - binsearchpath += ";."; - tmp = FileOpenSearch(binsearchpath, tmp); - } - - tmp = MakeAbsPath(OnlyPath(tmp)); - - // In case we are running in place and compiled with shared libraries - if (suffixIs(tmp, "/.libs/")) - tmp.erase(tmp.length() - 6, string::npos); - binpath_ = tmp; - - tmpdir_ = "/tmp"; - homepath_ = GetEnvPath("HOME"); - nulldev_ = "/dev/null"; -} - - -void warn(string const & /*mesg*/) -{ - return; -} +void init(int, char *[]) +{} string current_root() @@ -96,12 +51,6 @@ string::size_type common_path(string const & p1, string const & p2) } -string slashify_path(string const & p) -{ - return p; -} - - string external_path(string const & p) { return p; @@ -126,46 +75,27 @@ char const * popen_read_mode() } -string const & binpath() -{ - return binpath_; -} - - -string const & binname() -{ - return binname_; -} - - -void setTmpDir(string const & p) -{ - tmpdir_ = p; -} - - -string const & getTmpDir() +string const & nulldev() { - return tmpdir_; + static string const nulldev_ = "/dev/null"; + return nulldev_; } -string const & homepath() +shell_type shell() { - return homepath_; + return UNIX; } -string const & nulldev() +char path_separator() { - return nulldev_; + return ':'; } -shell_type shell() -{ - return UNIX; -} +void cygwin_path_fix(bool) +{} } // namespace os } // namespace support