--- rxvt-unicode/src/misc.C 2005/02/16 21:37:10 1.27 +++ rxvt-unicode/src/misc.C 2006/01/11 00:59:58 1.32 @@ -38,6 +38,7 @@ while (len--) { ssize_t l = wcrtomb (dst, *str++, mbs); + if (l < 0) *dst++ = '?'; else @@ -526,12 +527,7 @@ if (file == NULL || *file == '\0') return NULL; - /* search environment variables here too */ - if ((f = rxvt_File_search_path (path, file, ext)) == NULL) -#ifdef PATH_ENV - if ((f = rxvt_File_search_path (getenv (PATH_ENV), file, ext)) == NULL) -#endif - f = rxvt_File_search_path (getenv ("PATH"), file, ext); + f = rxvt_File_search_path (path, file, ext); #ifdef DEBUG_SEARCH_PATH if (f) @@ -555,7 +551,7 @@ { int shadow; - shadow = (w == 0 || h == 0) ? 1 : SHADOW; + shadow = (w == 0 || h == 0) ? 1 : MENU_SHADOW; w += x - 1; h += y - 1; for (; shadow-- > 0; x++, y++, w--, h--) @@ -610,4 +606,25 @@ } } #endif + +// should not be used in interactive programs, for obvious reasons +void rxvt_usleep (int usecs) +{ +#if HAVE_NANOSLEEP + struct timespec ts; + + ts.tv_sec = 0; + ts.tv_nsec = usecs * 1000; + nanosleep (&ts, NULL); +#else + /* use select for timing */ + struct timeval tv; + + tv.tv_sec = 0; + tv.tv_usec = usecs; + select (0, NULL, NULL, NULL, &tv); +#endif +} + /*----------------------- end-of-file (C source) -----------------------*/ +