Mercurial > vim
diff src/fileio.c @ 2770:25672ad7f377 v7.3.161
updated for version 7.3.161
Problem: Items on the stack may be too big.
Solution: Make items static or allocate them.
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 11 Apr 2011 21:35:11 +0200 |
parents | f85fe1a05c2a |
children | ee48b3da9d53 |
line wrap: on
line diff
--- a/src/fileio.c +++ b/src/fileio.c @@ -6023,15 +6023,19 @@ make_bom(buf, name) shorten_fname1(full_path) char_u *full_path; { - char_u dirname[MAXPATHL]; + char_u *dirname; char_u *p = full_path; + dirname = alloc(MAXPATHL); + if (dirname == NULL) + return full_path; if (mch_dirname(dirname, MAXPATHL) == OK) { p = shorten_fname(full_path, dirname); if (p == NULL || *p == NUL) p = full_path; } + vim_free(dirname); return p; } #endif