version 1.1, 2011/11/28 04:41:39 |
version 1.2, 2011/12/05 07:17:02 |
|
|
{ |
{ |
struct ctag *res; |
struct ctag *res; |
struct tagpos *s; |
struct tagpos *s; |
char *bname; |
char bname[NFILEN]; |
int doto, dotline; |
int doto, dotline; |
|
|
if ((res = searchtag(tok)) == NULL) |
if ((res = searchtag(tok)) == NULL) |
|
|
|
|
doto = curwp->w_doto; |
doto = curwp->w_doto; |
dotline = curwp->w_dotline; |
dotline = curwp->w_dotline; |
bname = curbp->b_bname; |
/* record absolute filenames. Fixes issues when mg's cwd is not the |
|
* same as buffer's directory. |
|
*/ |
|
if (strlcpy(bname, curbp->b_cwd, sizeof(bname)) >= sizeof(bname)) { |
|
ewprintf("filename too long"); |
|
return (FALSE); |
|
} |
|
if (strlcat(bname, curbp->b_bname, sizeof(bname)) >= sizeof(bname)) { |
|
ewprintf("filename too long"); |
|
return (FALSE); |
|
} |
|
|
if (loadbuffer(res->fname) == FALSE) |
if (loadbuffer(res->fname) == FALSE) |
return (FALSE); |
return (FALSE); |
|
|
return (FALSE); |
return (FALSE); |
} |
} |
if ((s->bname = strdup(bname)) == NULL) { |
if ((s->bname = strdup(bname)) == NULL) { |
ewprintf("Out of memory"); |
ewprintf("Out of memory"); |
return (FALSE); |
return (FALSE); |
} |
} |
s->doto = doto; |
s->doto = doto; |
s->dotline = dotline; |
s->dotline = dotline; |