To: vim-dev@vim.org Subject: Patch 5.7.029 Fcc: outbox From: Bram Moolenaar ------------ Patch 5.7.029 Problem: Editing a file with an extremely long name crashed Vim. Solution: Check for length of the name when setting the window title. Files: src/buffer.c *** ../vim-5.7.28/src/buffer.c Wed Jun 7 19:11:48 2000 --- src/buffer.c Tue Apr 24 10:16:54 2001 *************** *** 2035,2043 **** } } } *t_str = NUL; - while (*t_name) - STRCAT(t_str, transchar(*t_name++)); } } mustset = ti_change(t_str, &lasttitle); --- 2035,2046 ---- } } } + while (*t_name && t_str < buf + IOSIZE - 5) + { + STRCPY(t_str, transchar(*t_name++)); + t_str += STRLEN(t_str); + } *t_str = NUL; } } mustset = ti_change(t_str, &lasttitle); *************** *** 2060,2068 **** i_name = (char_u *)"No File"; else /* use file name only in icon */ i_name = gettail(curbuf->b_ffname); *i_str = NUL; - while (*i_name) - STRCAT(i_str, transchar(*i_name++)); } } --- 2063,2074 ---- i_name = (char_u *)"No File"; else /* use file name only in icon */ i_name = gettail(curbuf->b_ffname); + while (*i_name && i_str < buf + IOSIZE - 5) + { + STRCPY(i_str, transchar(*i_name++)); + i_str += STRLEN(i_str); + } *i_str = NUL; } } *** ../vim-5.7.28/src/version.c Tue Apr 3 11:57:10 2001 --- src/version.c Tue Apr 24 10:18:46 2001 *************** *** 439,440 **** --- 439,442 ---- { /* Add new patch number below this line */ + /**/ + 29, /**/ -- 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 - http://www.vim.org -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///