version 1.91, 2019/07/01 08:56:36 |
version 1.92, 2019/07/01 19:36:17 |
|
|
{ |
{ |
struct line *lp, *nlp; |
struct line *lp, *nlp; |
struct buffer *curbp; |
struct buffer *curbp; |
|
size_t lenfpath; |
char fpath[NFILEN], fname[NFILEN]; |
char fpath[NFILEN], fname[NFILEN]; |
char *p, *fnp = NULL; |
char *p, *fpth, *fnp = NULL; |
int tmp; |
int tmp; |
|
|
if (getbufcwd(fpath, sizeof(fpath)) != TRUE) |
if (getbufcwd(fpath, sizeof(fpath)) != TRUE) |
fpath[0] = '\0'; |
fpath[0] = '\0'; |
|
lenfpath = strlen(fpath); |
fnp = eread("Goto file: ", fpath, NFILEN, |
fnp = eread("Goto file: ", fpath, NFILEN, |
EFNEW | EFCR | EFFILE | EFDEF); |
EFNEW | EFCR | EFFILE | EFDEF); |
if (fnp == NULL) |
if (fnp == NULL) |
|
|
else if (fnp[0] == '\0') |
else if (fnp[0] == '\0') |
return (FALSE); |
return (FALSE); |
|
|
(void)xbasename(fname, fpath, NFILEN); |
fpth = adjustname(fpath, TRUE); /* Removes last '/' if */ |
|
if (strlen(fpth) == lenfpath - 1) { /* directory, hence -1. */ |
|
ewprintf("No file to find"); /* Current directory given so */ |
|
return (TRUE); /* return at present location. */ |
|
} |
|
(void)xbasename(fname, fpth, NFILEN); |
curbp = curwp->w_bufp; |
curbp = curwp->w_bufp; |
tmp = 0; |
tmp = 0; |
for (lp = bfirstlp(curbp); lp != curbp->b_headp; lp = nlp) { |
for (lp = bfirstlp(curbp); lp != curbp->b_headp; lp = nlp) { |