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>)
Этот коммит содержится в:
родитель
3ce320801f
Коммит
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>
|
1999-04-25 Sergei Ivanov <svivanov@pdmi.ras.ru>
|
||||||
|
|
||||||
* find.c: The origin of the bug is in the function do_search (file
|
* 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)
|
char *strip_home_and_password(char *dir)
|
||||||
{
|
{
|
||||||
|
size_t len;
|
||||||
static char newdir [MC_MAXPATHLEN];
|
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] = '~';
|
newdir [0] = '~';
|
||||||
strcpy (&newdir [1], &dir [strlen (home_dir)]);
|
strcpy (&newdir [1], &dir [strlen (home_dir)]);
|
||||||
return newdir;
|
return newdir;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user