fix adjust_name_for_index() to use index_file

cc @felixfontein

Signed-off-by: Chris Warrick <kwpolska@gmail.com>