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	2013-01-13 21:14:30.000000000 +0100
+++ bibtex2html/main.ml	2013-01-13 21:15:18.000000000 +0100
@@ -391,6 +391,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
 
@@ -420,7 +429,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 ->
