Roland Clobus wrote:
> Reading the code:
> * infile2 and outfile2 are made relative paths by using the path part of
> from_file
> * from_base is from_file with no extension.
> 
> > possibly we can use another $$ variable
> 
> $$p for Path to the original file looks ok to me:

i think the intention was that $$p is path of the input file
not path of the original file.

that said i'm not against adding new $$r variable. opinions?
pavel
 
> $$i (i)nput:  input filename with extension
> $$o (o)utput: output filename with extension
> $$b (b)ase:   full path with base filename (no extension)
> $$p (p)ath:   full path to original file, no filename parts ($$p/$$i is
> the full original location)
> 
> (NB: I cannot use the current directory, because it is changed, as
> mentioned in a comment in Converter.cpp, because e.g. lilypond requires
> it)
diff --git a/src/Converter.cpp b/src/Converter.cpp
index b9c31bd..fd4e785 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -48,6 +48,7 @@ string const token_from("$$i");
 string const token_base("$$b");
 string const token_to("$$o");
 string const token_path("$$p");
+string const token_orig_path("$$r");
 
 
 
@@ -394,6 +395,8 @@ bool Converters::convert(Buffer const * buffer,
                        command = subst(command, token_from, 
quoteName(infile2));
                        command = subst(command, token_base, 
quoteName(from_base));
                        command = subst(command, token_to, quoteName(outfile2));
+                       command = subst(command, token_path, 
quoteName(infile.onlyPath().absFilename()));
+                       command = subst(command, token_orig_path, 
quoteName(orig_from.onlyPath().absFilename()));
                        command = libScriptSearch(command);
 
                        if (!conv.parselog.empty())

Reply via email to