Am Mittwoch, 29. März 2006 05:16 schrieb Bo Peng:
> The patch does not look nice, but seem to work. One problem I find is
> that if I export the file to latex, the mangled bst filename will be
> used.

I am glad that you did this, one bug less on my TODO list :-)
It would be nice if you could fix some minor problems before this can go
in.

> bstwithspace.diff
>   Index: src/insets/insetbibtex.C
> ===================================================================
> --- src/insets/insetbibtex.C    (revision 13500)
> +++ src/insets/insetbibtex.C    (working copy)
> @@ -207,8 +207,25 @@
>         int nlines = 0;
>  
>         if (!style.empty()) {
> +               string new_style = style;
> +               // if style contains space, copy to the tmp directory
> +               if (contains(style, ' ')) {

Only copy the file if runparams.nice == false. This is consistent with
insetgraphics and insetinclude. You should probably output a warning if
runparams.nice == true and the filename contains spaces (see the .bib file
handling).

> +                       string const in_file = style + ".bst";
> +                       if (IsFileReadable(in_file)) {
> +                               // use new style name
> +                               new_style = FileName(style).mangledFilename();

mangledFilename() should be called on complete filenames (with extension).
Please use something like

string output_file = style + ".bst"

instead of new_style. The rest looks good.


Georg

Reply via email to