mirror of
https://github.com/MidnightCommander/mc
synced 2025-01-08 20:41:59 +03:00
Tue Apr 27 20:31:13 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
* src/util.c (strip_home_and_password): Don't split the path in the middle of a directory, e.g. "/home/bofh" will not be translated to "~h" (fixes the bug reported by Alex Fortuna <alex@rdc.ru>)
This commit is contained in:
parent
3ce320801f
commit
2c53bb4eb5
@ -1,3 +1,9 @@
|
||||
Tue Apr 27 20:31:13 1999 Norbert Warmuth <nwarmuth@privat.circular.de>
|
||||
|
||||
* util.c (strip_home_and_password): Don't split the path in the
|
||||
middle of a directory, e.g. "/home/bofh" will not be translated to
|
||||
"~h" (fixes the bug reported by Alex Fortuna <alex@rdc.ru>)
|
||||
|
||||
1999-04-25 Sergei Ivanov <svivanov@pdmi.ras.ru>
|
||||
|
||||
* find.c: The origin of the bug is in the function do_search (file
|
||||
|
@ -384,9 +384,11 @@ strip_password (char *p, int has_prefix)
|
||||
|
||||
char *strip_home_and_password(char *dir)
|
||||
{
|
||||
size_t len;
|
||||
static char newdir [MC_MAXPATHLEN];
|
||||
|
||||
if (home_dir && !strncmp (dir, home_dir, strlen (home_dir))){
|
||||
if (home_dir && !strncmp (dir, home_dir, len = strlen (home_dir)) &&
|
||||
(dir[len] == PATH_SEP || dir[len] == '\0')){
|
||||
newdir [0] = '~';
|
||||
strcpy (&newdir [1], &dir [strlen (home_dir)]);
|
||||
return newdir;
|
||||
|
Loading…
Reference in New Issue
Block a user