using std::endl;
using std::ifstream;
+#if 0
+using std::getenv;
+using std::isalpha;
+using std::isalnum;
+using std::popen;
+#endif
+
extern string system_lyxdir;
extern string build_lyxdir;
extern string user_lyxdir;
string const GetEnv(string const & envname)
{
// f.ex. what about error checking?
- char const * const ch = ::getenv(envname.c_str());
+ char const * const ch = getenv(envname.c_str());
string const envstr = !ch ? "" : ch;
return envstr;
}
// checks for already absolute path
if (AbsolutePath(RelPath))
#ifdef __EMX__
- if(RelPath[0]!= '/' && RelPath[0]!= '\\')
+ if (RelPath[0]!= '/' && RelPath[0]!= '\\')
#endif
return RelPath;
if (Temp == ".") continue;
if (Temp == "..") {
// Remove one level of TempBase
- int i = TempBase.length() - 2;
+ string::difference_type i = TempBase.length() - 2;
#ifndef __EMX__
if (i < 0) i = 0;
while (i > 0 && TempBase[i] != '/') --i;
TempBase = "./";
} else if (Temp == "..") {
// Remove one level of TempBase
- int i = TempBase.length() - 2;
+ string::difference_type i = TempBase.length() - 2;
while (i > 0 && TempBase[i] != '/')
--i;
if (i >= 0 && TempBase[i] == '/')
if (abspath.empty())
return "<unknown_path>";
- int const abslen = abspath.length();
- int const baselen = basepath.length();
+ string::size_type const abslen = abspath.length();
+ string::size_type const baselen = basepath.length();
// Find first different character
- int i = 0;
+ string::size_type i = 0;
while (i < abslen && i < baselen && abspath[i] == basepath[i]) ++i;
// Go back to last /
// Count how many dirs there are in basepath above match
// and append as many '..''s into relpath
string buf;
- int j = i;
+ string::size_type j = i;
while (j < baselen) {
if (basepath[j] == '/') {
if (j + 1 == baselen) break;
}
if (!path2.empty()){
- int p2start = path2.find_first_not_of('/');
+ string::size_type p2start = path2.find_first_not_of('/');
- int p2end = path2.find_last_not_of('/');
+ string::size_type p2end = path2.find_last_not_of('/');
string tmp = path2.substr(p2start, p2end - p2start + 1);
buf += tmp + '/';
string const
MakeDisplayPath (string const & path, unsigned int threshold)
{
- int const l1 = path.length();
+ string::size_type const l1 = path.length();
// First, we try a relative path compared to home
string const home(GetEnvPath("HOME"));
string relhome = MakeRelPath(path, home);
- unsigned int l2 = relhome.length();
+ string::size_type l2 = relhome.length();
string prefix;