export which.first + which.last
fix snprintf in rules.c