[latexila] BibTeX and MakeIndex: fix problems for writing *.blg or *.ind files



commit fd65b8a7b355ef2162c7963cc3f4442b6aa0498e
Author: SÃbastien Wilmet <swilmet src gnome org>
Date:   Fri Jul 15 23:33:59 2011 +0200

    BibTeX and MakeIndex: fix problems for writing *.blg or *.ind files
    
    Before, the commands were run with absolute paths. For security reasons,
    the option "openout_any = p" doesn't allow that. So now relative paths
    are used.

 TODO                       |    2 --
 src/build_tool_runner.vala |   21 +++++++--------------
 2 files changed, 7 insertions(+), 16 deletions(-)
---
diff --git a/TODO b/TODO
index 3bf19c6..9c67182 100644
--- a/TODO
+++ b/TODO
@@ -10,8 +10,6 @@ LaTeXila 2.2
 	- use gnome-doc-utils (autotools are required, so bye bye CMake :( )
 
 - Build Tools:
-	- BibTeX: problem writing .blg file
-	- MakeIndex: problem writing .ind file
 	- Some problems with the latex and latexmk post processors
 
 - Structure:
diff --git a/src/build_tool_runner.vala b/src/build_tool_runner.vala
index 5d3c0ff..49f820f 100644
--- a/src/build_tool_runner.vala
+++ b/src/build_tool_runner.vala
@@ -83,7 +83,7 @@ public class BuildToolRunner : GLib.Object
 
         foreach (BuildJob job in jobs)
         {
-            string[] command = get_command (job, true, true);
+            string[] command = get_command (job, true);
             job_partitions += view.add_partition (string.joinv (" ", command),
                 PartitionState.RUNNING, root_partition);
         }
@@ -301,7 +301,7 @@ public class BuildToolRunner : GLib.Object
         output = "";
 
         current_job = jobs.nth_data (job_num);
-        string[] command = get_command (current_job, false);
+        string[] command = get_command (current_job);
 
         // Attention, rubber doesn't support filenames with spaces, warn the user
         if (current_job.post_processor == PostProcessorType.RUBBER
@@ -341,16 +341,10 @@ public class BuildToolRunner : GLib.Object
         }
     }
 
-    private string[] get_command (BuildJob build_job, bool basename,
-        bool for_printing = false)
+    private string[] get_command (BuildJob build_job, bool for_printing = false)
     {
-        string base_filename = null;
-        string base_shortname = null;
-        if (basename)
-        {
-            base_filename = file.get_basename ();
-            base_shortname = Utils.get_shortname (base_filename);
-        }
+        string base_filename = file.get_basename ();
+        string base_shortname = Utils.get_shortname (base_filename);
 
         string[] command = {};
 
@@ -414,13 +408,12 @@ public class BuildToolRunner : GLib.Object
             }
             if (command[i].contains ("$filename"))
             {
-                command[i] = command[i].replace ("$filename", base_filename ?? filename);
+                command[i] = command[i].replace ("$filename", base_filename);
                 continue;
             }
             if (command[i].contains ("$shortname"))
             {
-                command[i] = command[i].replace ("$shortname",
-                    base_shortname ?? shortname);
+                command[i] = command[i].replace ("$shortname", base_shortname);
                 continue;
             }
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]