]> git.lyx.org Git - lyx.git/blobdiff - src/support/filetools.C
Fix the line-delete-forward bug?
[lyx.git] / src / support / filetools.C
index 4847419b498c661bbbf75793bf34a7b0c8a65497..33b0d1a70ce50859b90d76ee7a9cdfa6341649c8 100644 (file)
@@ -91,9 +91,7 @@ string MakeLatexName(string const & file)
 // Substitutes spaces with underscores in filename (and path)
 string QuoteName(string const & name)
 {
-#ifdef WITH_WARNINGS
-#warning Add proper emx support here!
-#endif
+       // CHECK Add proper emx support here!
 #ifndef __EMX__
        return '\'' + name + '\'';
 #else
@@ -305,9 +303,7 @@ string GetEnvPath(string const & name)
 
 bool PutEnv(string const & envstr)
 {
-#ifdef WITH_WARNINGS
-#warning Look at and fix this.
-#endif
+       // CHECK Look at and fix this.
         // f.ex. what about error checking?
 #if HAVE_PUTENV
         // this leaks, but what can we do about it?
@@ -752,7 +748,7 @@ string ReplaceEnvironmentPath(string const & path)
                if (!regexMatch(copy1, RegExp)) {
                        // No EndChar inside. So we are finished
                        result1 += CompareString + result0;
-                       result0.clear();
+                       result0.erase();
                        continue;
                }
 
@@ -896,8 +892,7 @@ string AddPath(string const & path, string const & path_2)
  Strips path off if no_path == true.
  If no extension on oldname, just appends.
  */
-string ChangeExtension(string const & oldname, string const & extension, 
-                       bool no_path) 
+string ChangeExtension(string const & oldname, string const & extension)
 {
        string::size_type last_slash = oldname.rfind('/');
        string::size_type last_dot = oldname.rfind('.');
@@ -910,14 +905,8 @@ string ChangeExtension(string const & oldname, string const & extension,
                ext= '.' + extension;
        else
                ext = extension;
-       string ret_str;
-       if (no_path && last_slash != string::npos) {
-               ++last_slash; // step it
-               ret_str = oldname.substr(last_slash,
-                                        last_dot - last_slash) + ext;
-       } else
-               ret_str = oldname.substr(0, last_dot) + ext;
-       return CleanupPath(ret_str);
+
+       return CleanupPath(oldname.substr(0, last_dot) + ext);
 }