# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1321643540 0 # Node ID cdbe26a4b116b6b809cc87dedf264b2734706e33 # Parent 412af8059331b8efa68865215a177306e17e622f Mingw doesn't like writing to a compile time variable in dw_menu_append_item()... So make a temporary copy and do it there to prevent crashes. diff -r 412af8059331 -r cdbe26a4b116 win/dw.c --- a/win/dw.c Fri Nov 18 18:56:40 2011 +0000 +++ b/win/dw.c Fri Nov 18 19:12:20 2011 +0000 @@ -4933,6 +4933,7 @@ HMENU mymenu = (HMENU)menux; char buffer[31] = {0}; int is_checked, is_disabled; + char *menutitle = title; /* * Check if this is a menubar; if so get the menu object @@ -4948,7 +4949,9 @@ /* Convert from OS/2 style accellerators to Win32 style */ if (title) { - char *tmp = title; + char *tmp = menutitle = _alloca(strlen(title)+1); + + strcpy(tmp, title); while(*tmp) { @@ -4958,7 +4961,7 @@ } } - if (title && *title) + if (menutitle && *menutitle) { /* Code to autogenerate a menu ID if not specified or invalid * First pool is smaller for transient popup menus @@ -5011,8 +5014,8 @@ mii.hSubMenu = (HMENU)submenu; else mii.hSubMenu = 0; - mii.dwTypeData = title; - mii.cch = strlen(title); + mii.dwTypeData = menutitle; + mii.cch = strlen(menutitle); InsertMenuItem(mymenu, 65535, TRUE, &mii);