X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=menus.c;h=f786eda5a939f535b2e8f742e7c0731b57cb1f65;hb=02c925e3932929a5eb4e9a2d6d025f383670ebf6;hp=d5744f7090277f73602c02855349e1be989bcdb8;hpb=14e974a23221e71fca09f83dfe240dfc1194db45;p=xboard.git diff --git a/menus.c b/menus.c index d5744f7..f786eda 100644 --- a/menus.c +++ b/menus.c @@ -869,14 +869,14 @@ Menu menuBar[] = { MenuItem * MenuNameToItem (char *menuName) { - int i; + int i=0; char buf[MSG_SIZ], *p; MenuItem *menuTab; static MenuItem a = { NULL, NULL, NothingProc }; extern Option mainOptions[]; safeStrCpy(buf, menuName, MSG_SIZ); p = strchr(buf, '.'); - if(!p) menuTab = noMenu; else { + if(!p) menuTab = noMenu, p = menuName; else { *p++ = NULLCHAR; for(i=0; menuBar[i].name; i++) if(!strcmp(buf, menuBar[i].name)) break;