Description: expand the path name of bibtex styles that correspond to files
             in the current directory
Author: Ralf Treinen <treinen@debian.org>
Debian-Bug: #698004 

Index: bibtex2html/main.ml
===================================================================
--- bibtex2html.orig/main.ml	2014-07-06 19:28:16.555375961 +0200
+++ bibtex2html/main.ml	2014-07-06 19:28:16.551375961 +0200
@@ -405,6 +405,15 @@
 ";
   exit (if error then 1 else 0)
 
+let kpsewhich s =
+  (* see how the tex library would expand s.bst. If the path name starts *)
+  (* on '.' then we prefix it with the current working directory.        *)
+  try
+    let e = input_line (Unix.open_process_in ("kpsewhich "^s^".bst"))
+    in if String.get e 0 = '.' then (Sys.getcwd ())^"/"^s else s
+  with End_of_file -> s
+;;
+
 let parse () =
   let rec parse_rec = function
 
@@ -434,7 +443,7 @@
     | ("-footer" | "--footer") :: [] ->
 	usage()
     | ("-s" | "-style" | "--style") :: s :: rem ->
-	style := s; parse_rec rem
+	style := kpsewhich s; parse_rec rem
     | ("-s" | "-style" | "--style") :: [] ->
 	usage()
     | ("-noabstract" | "-no-abstract" | "--no-abstract") :: rem ->
