Fix file name not printed correctly when opening it

This issue was introduced in 34c12b1.