complete ~ in local paths (noted by perry@netbsd.org)
This commit is contained in:
parent
f177c46ba0
commit
b8ebb2ba4e
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: complete.c,v 1.16 1998/08/08 07:51:30 lukem Exp $ */
|
||||
/* $NetBSD: complete.c,v 1.17 1999/02/07 12:27:50 lukem Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997 The NetBSD Foundation, Inc.
|
||||
|
@ -40,7 +40,7 @@
|
|||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: complete.c,v 1.16 1998/08/08 07:51:30 lukem Exp $");
|
||||
__RCSID("$NetBSD: complete.c,v 1.17 1999/02/07 12:27:50 lukem Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
/*
|
||||
|
@ -194,6 +194,18 @@ complete_local(word, list)
|
|||
}
|
||||
file++;
|
||||
}
|
||||
if (dir[0] == '~') {
|
||||
char *p;
|
||||
|
||||
p = dir;
|
||||
if (!globulize(&p))
|
||||
return (CC_ERROR);
|
||||
if (p != dir) {
|
||||
strncpy(dir, p, sizeof(dir));
|
||||
dir[sizeof(dir)-1] = '\0';
|
||||
free(p);
|
||||
}
|
||||
}
|
||||
|
||||
if ((dd = opendir(dir)) == NULL)
|
||||
return (CC_ERROR);
|
||||
|
|
Loading…
Reference in New Issue