mirror of
git://git.sv.gnu.org/nano.git
synced 2025-01-22 17:22:19 +03:00
in striponedir(), since all the strings passed to this are dynamically
allocated, use null_at() to strip the directory from the string git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3703 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
8cd0d2c751
commit
fef232a672
@ -27,6 +27,10 @@ CVS code -
|
|||||||
(DLR)
|
(DLR)
|
||||||
findnextfile()
|
findnextfile()
|
||||||
- Simplify the uses of tail(). (DLR)
|
- Simplify the uses of tail(). (DLR)
|
||||||
|
striponedir()
|
||||||
|
- Since all the strings passed to this are dynamically
|
||||||
|
allocated, use null_at() to strip the directory from the
|
||||||
|
string. (DLR)
|
||||||
- doc/syntax/c.nanorc:
|
- doc/syntax/c.nanorc:
|
||||||
- Since .i and .ii are preprocessed C and C++ output, colorize
|
- Since .i and .ii are preprocessed C and C++ output, colorize
|
||||||
them here. (Mike Frysinger)
|
them here. (Mike Frysinger)
|
||||||
|
@ -334,7 +334,6 @@ char *do_browser(char *path, DIR *dir)
|
|||||||
"..") == 0) {
|
"..") == 0) {
|
||||||
prev_dir = mallocstrcpy(NULL, filelist[selected]);
|
prev_dir = mallocstrcpy(NULL, filelist[selected]);
|
||||||
striponedir(prev_dir);
|
striponedir(prev_dir);
|
||||||
align(&prev_dir);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dir = opendir(filelist[selected]);
|
dir = opendir(filelist[selected]);
|
||||||
@ -967,7 +966,8 @@ void do_last_file(void)
|
|||||||
selected = filelist_len - 1;
|
selected = filelist_len - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Strip one directory from the end of path. */
|
/* Strip one directory from the end of path, which should be
|
||||||
|
* dynamically allocated. */
|
||||||
void striponedir(char *path)
|
void striponedir(char *path)
|
||||||
{
|
{
|
||||||
char *tmp;
|
char *tmp;
|
||||||
@ -977,7 +977,7 @@ void striponedir(char *path)
|
|||||||
tmp = strrchr(path, '/');
|
tmp = strrchr(path, '/');
|
||||||
|
|
||||||
if (tmp != NULL)
|
if (tmp != NULL)
|
||||||
*tmp = '\0';
|
null_at(&path, tmp - path);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !DISABLE_BROWSER */
|
#endif /* !DISABLE_BROWSER */
|
||||||
|
Loading…
Reference in New Issue
Block a user