Eventually, I filed a bugreport, and it can be found at http://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=22253 It seemed to me that the `-O2' optimization got confused with the declaration unsigned limit; All my books on C tell me that one should use unsigned int limit; but `unsigned var;' is all over the kpathsea source, so it must be correct). In any case, for RH 7.0 users, either of the following solves the problem: --Compile teTeX with CFLAGS='-g -O' to configure --Compile teTeX with CC='kcc' to configure -- In texk/kpathsea/xdirname.c change unsigned limit = 0, loc; to unsigned int limit = 0, loc; -- In texk/kpathsea/xdirname.c change for (loc = strlen (name); loc > limit && !IS_DIR_SEP (name[loc-1]); loc--) to for (loc = strlen (name); limit < loc && !IS_DIR_SEP (name[loc-1]); loc--) Mate