[BACK]Return to tags.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/tags.c between version 1.1 and 1.2

version 1.1, 2011/11/28 04:41:39 version 1.2, 2011/12/05 07:17:02
Line 208 
Line 208 
 {  {
         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)
Line 216 
Line 216 
   
         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);
Line 227 
Line 237 
                         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;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2