Another patch to fix a bug

Victor A. Riley (var@iris.brown.edu)
Wed, 1 May 91 16:36:04 EDT

Here is another patch for main.c. It assumes that the previous patch
has been applied. What this fix does is saves the first encounter of
a misc./unknown face, then continues looking for another face match.
This is useful when you have several face databases. For this to work
properly, you should have the misc. faces in the sample facedir installed
in the same location as your local face database, for instance
in /usr/local/faces. If you have the logos face database, just move the
logos/misc. directory up one level in the hierarchy.

As a future bug fix we can modify the Makefile.dist file so that it
does this when you do a 'make tables'.

Victor Riley

=====8<====8<====
*** main.c.old Wed May 1 16:16:13 1991
--- main.c Wed May 1 16:10:45 1991
***************
*** 582,587 ****
--- 582,589 ----
* 4 both. - ICON_BOTH.
*/

+ static char miscsave[MAXLINE] ; /* Saved path of the unknown icon file. */
+ int savecode = ICON_NOTFOUND ;
char *cptr, *icomm[3], *iuser[3], *path ;
int i, ic, id, iu ;

***************
*** 639,646 ****
SPRINTF(iconname, "%s/%s/%s/%s",
facepath[id], cptr, iuser[iu], fname[i]) ;
IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
#ifdef NAMEUNKNOWN
! if (EQUAL(iser[iu], "unknown")) STRCPY(user, "unknown") ;
#endif /*NAMEUNKNOWN*/
chdir(iwd);
return((enum min_type) (4 - (((ic & 1) << 1) + (iu & 1)))) ;
--- 641,656 ----
SPRINTF(iconname, "%s/%s/%s/%s",
facepath[id], cptr, iuser[iu], fname[i]) ;
IF_DEBUG( FPRINTF(stderr, "found as %s\n", iconname) ; )
+ if ((EQUAL(icomm[ic], "misc."))
+ && (EQUAL(iuser[iu], "unknown")))
+ {
+ STRCPY(miscsave, iconname) ;
+ savecode =
+ ((enum min_type) (4 - (((ic & 1) << 1) + (iu & 1)))) ;
+ continue ;
+ }
#ifdef NAMEUNKNOWN
! if (EQUAL(iuser[iu], "unknown")) STRCPY(user, "unknown") ;
#endif /*NAMEUNKNOWN*/
chdir(iwd);
return((enum min_type) (4 - (((ic & 1) << 1) + (iu & 1)))) ;
***************
*** 652,657 ****
--- 662,673 ----
}

/* Face icon not found, so the "blank face" should be used. */
+
+ if (savecode != ICON_NOTFOUND)
+ {
+ STRCPY(iconname, miscsave) ;
+ return((enum min_type) savecode) ;
+ }

return(ICON_NOTFOUND) ;
}