Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
2769:ccce1db172b3 | 2770:25672ad7f377 |
---|---|
6021 */ | 6021 */ |
6022 char_u * | 6022 char_u * |
6023 shorten_fname1(full_path) | 6023 shorten_fname1(full_path) |
6024 char_u *full_path; | 6024 char_u *full_path; |
6025 { | 6025 { |
6026 char_u dirname[MAXPATHL]; | 6026 char_u *dirname; |
6027 char_u *p = full_path; | 6027 char_u *p = full_path; |
6028 | 6028 |
6029 dirname = alloc(MAXPATHL); | |
6030 if (dirname == NULL) | |
6031 return full_path; | |
6029 if (mch_dirname(dirname, MAXPATHL) == OK) | 6032 if (mch_dirname(dirname, MAXPATHL) == OK) |
6030 { | 6033 { |
6031 p = shorten_fname(full_path, dirname); | 6034 p = shorten_fname(full_path, dirname); |
6032 if (p == NULL || *p == NUL) | 6035 if (p == NULL || *p == NUL) |
6033 p = full_path; | 6036 p = full_path; |
6034 } | 6037 } |
6038 vim_free(dirname); | |
6035 return p; | 6039 return p; |
6036 } | 6040 } |
6037 #endif | 6041 #endif |
6038 | 6042 |
6039 /* | 6043 /* |