dir.c: rename cryptic 'which' variable to more consistent name