Commits

"Rör...@gmail.com>"  committed ca36e33

made renumber inner function of main.

  • Participants
  • Parent commits 4c5d3ad

Comments (0)

Files changed (1)

File footnotes.ml

     output_endline outc (Str.string_after l (Str.match_end ())) in
   process_foots inc print_foot (output_endline outc)
 
-(* renumber the footnote references *)
-let renumber by_foots =
-  if by_foots then renumber_by_foots else renumber_by_body
-
 (* process options and files given on command line or stdin *)
 let main () =
   if Array.length Sys.argv > 1 then
     let by_foots = ref false in
     let do_file f =
-      let c = open_in f in
-      (try renumber !by_foots c stdout with e -> close_in c; raise e);
+      let renumber =
+	if !by_foots then renumber_by_foots else renumber_by_body
+      and c = open_in f in
+      (try renumber c stdout with e -> close_in c; raise e);
       close_in c in
     Arg.parse [("-f", Arg.Set by_foots,
 		"Renumber footnotes by their original order")]