comparison lwlib/xlwmenu.c @ 290:c9fe270a4101 r21-0b43

Import from CVS: tag r21-0b43
author cvs
date Mon, 13 Aug 2007 10:36:47 +0200
parents c5d627a313b1
children afd57c14dfc8
comparison
equal deleted inserted replaced
289:6e6992ccc4b6 290:c9fe270a4101
415 # else /* ! USE_XFONTSET */ 415 # else /* ! USE_XFONTSET */
416 XCharStruct xcs; 416 XCharStruct xcs;
417 int drop; 417 int drop;
418 # endif 418 # endif
419 #endif 419 #endif
420 char newchars[64]; 420 char* newchars;
421 int charslength;
421 char *chars; 422 char *chars;
422 int i, j; 423 int i, j;
423 424
424 #ifdef NEED_MOTIF 425 #ifdef NEED_MOTIF
425 if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars)) 426 if (!XmStringGetLtoR (string, XmFONTLIST_DEFAULT_TAG, &chars))
427 chars = ""; 428 chars = "";
428 } 429 }
429 #else 430 #else
430 chars = string; 431 chars = string;
431 #endif 432 #endif
432 433 charslength = strlen (chars);
433 for (i = j = 0; chars[i] && (j < (int) sizeof (newchars)); i++) 434 newchars = (char *) alloca (charslength + 1);
435
436 for (i = j = 0; chars[i] && (j < charslength); i++)
434 if (chars[i]=='%'&&chars[i+1]=='_') 437 if (chars[i]=='%'&&chars[i+1]=='_')
435 i++; 438 i++;
436 else 439 else
437 newchars[j++] = chars[i]; 440 newchars[j++] = chars[i];
438 newchars[j] = '\0'; 441 newchars[j] = '\0';