]> git.lyx.org Git - features.git/blobdiff - src/insets/insetexternal.C
fix starting up which binary is really a symlink; make sure insetinclude file browser...
[features.git] / src / insets / insetexternal.C
index 735480991cc9c7671cbe9a4382ff3aa2172c4ed5..0349abad2bfc46bab2c6a12d49a2d5426dd3a071 100644 (file)
@@ -214,13 +214,11 @@ string const InsetExternal::getScreenLabel(Buffer const *) const
 void InsetExternal::executeCommand(string const & s,
                                   Buffer const * buffer) const
 {
-       string buf = MakeAbsPath(buffer->fileName());
-       string path = OnlyPath(buf);
-       Path p(path);
+       Path p(buffer->filePath());
        Systemcalls one;
        if (lyxerr.debugging()) {
                lyxerr << "Executing '" << s << "' in '"
-                      << path << "'" << endl;
+                      << buffer->filePath() << "'" << endl;
        }
        one.startscript(Systemcalls::Wait, s);
 }
@@ -231,9 +229,9 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
 {
        string result;
        string const basename = ChangeExtension(params_.filename, string());
-       string filepath = "";
+       string filepath;
        if (buffer && (!buffer->niceFile)) {
-               filepath = OnlyPath(MakeAbsPath(buffer->fileName()));
+               filepath = buffer->filePath();
        }
        result = subst(s, "$$FName", params_.filename);
        result = subst(result, "$$Basename", basename);
@@ -252,9 +250,7 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
                string contents;
                if (buffer) {
                        // Make sure we are in the directory of the buffer
-                       string const buf = MakeAbsPath(buffer->fileName());
-                       string const path = OnlyPath(buf);
-                       Path p(path);
+                       Path p(buffer->filePath());
                        contents = GetFileContents(file);
                } else {
                        contents = GetFileContents(file);