Browse Source

Merge branch 'fix_lyx.exe_case_sensitive' into develop

Kolan Sh 6 months ago
parent
commit
9f00c580db
1 changed files with 5 additions and 4 deletions
  1. 5
    4
      src/conv/main.vala

+ 5
- 4
src/conv/main.vala View File

@@ -53,10 +53,11 @@ namespace LAview {
53 53
 					throw new IOError.NOT_FOUND(_("File ")+tex_file+_(" not found"));
54 54
 				if (!File.new_for_path(lyx_file_path).get_parent().query_exists())
55 55
 					throw new IOError.NOT_FOUND(_("Target directory for ")+lyx_file_path+_(" does not exist"));
56
-				var last_index_of = lyx_path.last_index_of ("lyx");
57
-				if (last_index_of == -1) throw new IOError.NOT_FOUND(_("Cann't find tex2lyx command"));
58
-				var tex2lyx_path = lyx_path.substring(0, last_index_of)
59
-				                   + "tex2" + lyx_path.offset(last_index_of);
56
+				var tex2lyx_path = lyx_path;
57
+				var regex = new Regex("lyx$");
58
+				tex2lyx_path = regex.replace(tex2lyx_path, tex2lyx_path.length, 0, "tex2lyx");
59
+				regex = new Regex("[Ll][Yy][Xx].exe$");
60
+				tex2lyx_path = regex.replace(tex2lyx_path, tex2lyx_path.length, 0, "tex2lyx.exe");
60 61
 				return (new SubprocessLauncher(  SubprocessFlags.STDIN_PIPE
61 62
 				                               | SubprocessFlags.STDOUT_PIPE
62 63
 				                               | SubprocessFlags.STDERR_PIPE))

Loading…
Cancel
Save