comparison src/menubar-msw.c @ 400:a86b2b5e0111 r21-2-30

Import from CVS: tag r21-2-30
author cvs
date Mon, 13 Aug 2007 11:14:34 +0200
parents 74fd4e045ea6
children 2f8bb876ab1d
comparison
equal deleted inserted replaced
399:376370fb5946 400:a86b2b5e0111
134 /* Left flush part of the string */ 134 /* Left flush part of the string */
135 ll = gui_item_display_flush_left (gui_item, buf, MAX_MENUITEM_LENGTH); 135 ll = gui_item_display_flush_left (gui_item, buf, MAX_MENUITEM_LENGTH);
136 136
137 /* Escape '&' as '&&' */ 137 /* Escape '&' as '&&' */
138 ptr = buf; 138 ptr = buf;
139 while ((ptr=memchr (ptr, '&', ll-(ptr-buf))) != NULL) 139 while ((ptr = (char*) memchr (ptr, '&', ll - (ptr - buf))) != NULL)
140 { 140 {
141 if (ll+2 >= MAX_MENUITEM_LENGTH) 141 if (ll + 2 >= MAX_MENUITEM_LENGTH)
142 signal_simple_error ("Menu item produces too long displayable string", 142 signal_simple_error ("Menu item produces too long displayable string",
143 XGUI_ITEM (gui_item)->name); 143 XGUI_ITEM (gui_item)->name);
144 memmove (ptr+1, ptr, (ll-(ptr-buf))+1); 144 memmove (ptr + 1, ptr, (ll - (ptr - buf)) + 1);
145 ll++; 145 ll++;
146 ptr+=2; 146 ptr += 2;
147 } 147 }
148 148
149 /* Replace XEmacs accelerator '%_' with Windows accelerator '&' */ 149 /* Replace XEmacs accelerator '%_' with Windows accelerator '&' */
150 ptr = buf; 150 ptr = buf;
151 while ((ptr=memchr (ptr, '%', ll-(ptr-buf))) != NULL) 151 while ((ptr = (char*) memchr (ptr, '%', ll - (ptr - buf))) != NULL)
152 { 152 {
153 if (*(ptr+1) == '_') 153 if (*(ptr + 1) == '_')
154 { 154 {
155 *ptr = '&'; 155 *ptr = '&';
156 memmove (ptr+1, ptr+2, ll-(ptr-buf+2)); 156 memmove (ptr + 1, ptr + 2, ll - (ptr - buf + 2));
157 ll--; 157 ll--;
158 } 158 }
159 ptr++; 159 ptr++;
160 } 160 }
161 161