To: vim-dev@vim.org Subject: Patch 6.1.351 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.351 (depends on 6.1.349) Problem: Crash when starting Vim the first time in an X server. (John McGowan) Solution: Don't call xFree() with a fixed string. Files: src/if_xcmdsrv.c *** ../vim61.350/src/if_xcmdsrv.c Thu Feb 20 21:54:31 2003 --- src/if_xcmdsrv.c Fri Feb 21 22:11:11 2003 *************** *** 189,194 **** --- 189,196 ---- static Atom vimProperty = None; static int got_x_error = FALSE; + static char_u *empty_prop = (char_u *)""; /* empty GetRegProp() result */ + /* * Associate an ASCII name with Vim. Try real hard to get a unique one. * Returns FAIL or OK. *************** *** 667,673 **** p++; } } ! XFree(regProp); return ga.ga_data; } --- 669,676 ---- p++; } } ! if (regProp != empty_prop) ! XFree(regProp); return ga.ga_data; } *************** *** 983,989 **** XSync(dpy, False); } ! XFree(regProp); return (Window)returnValue; } --- 986,993 ---- XSync(dpy, False); } ! if (regProp != empty_prop) ! XFree(regProp); return (Window)returnValue; } *************** *** 1048,1058 **** XSync(dpy, False); } ! XFree(regProp); } /* * Read the registry property. Delete it when it's formatted wrong. * Return OK when successful. */ static int --- 1052,1065 ---- XSync(dpy, False); } ! if (regProp != empty_prop) ! XFree(regProp); } /* * Read the registry property. Delete it when it's formatted wrong. + * Return the property in "regPropp". "empty_prop" is used when it doesn't + * exist yet. * Return OK when successful. */ static int *************** *** 1077,1083 **** { /* No prop yet. Logically equal to the empty list */ *numItemsp = 0; ! *regPropp = (char_u *)""; return OK; } --- 1084,1090 ---- { /* No prop yet. Logically equal to the empty list */ *numItemsp = 0; ! *regPropp = empty_prop; return OK; } *** ../vim61.350/src/version.c Thu Feb 20 22:03:24 2003 --- src/version.c Fri Feb 21 22:17:18 2003 *************** *** 608,609 **** --- 612,615 ---- { /* Add new patch number below this line */ + /**/ + 351, /**/ -- MORTICIAN: Bring out your dead! [clang] Bring out your dead! [clang] Bring out your dead! CUSTOMER: Here's one -- nine pence. DEAD PERSON: I'm not dead! The Quest for the Holy Grail (Monty Python) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///