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

Diff for /src/usr.bin/mg/grep.c between version 1.39 and 1.40

version 1.39, 2013/06/01 17:31:11 version 1.40, 2014/03/20 07:47:29
Line 193 
Line 193 
         if (getcwd(cwd, sizeof(cwd)) == NULL)          if (getcwd(cwd, sizeof(cwd)) == NULL)
                 panic("Can't get current directory!");                  panic("Can't get current directory!");
         if (chdir(bp->b_cwd) == -1) {          if (chdir(bp->b_cwd) == -1) {
                   dobeep();
                 ewprintf("Can't change dir to %s", bp->b_cwd);                  ewprintf("Can't change dir to %s", bp->b_cwd);
                 return (NULL);                  return (NULL);
         }          }
         if ((fpipe = popen(qcmd, "r")) == NULL) {          if ((fpipe = popen(qcmd, "r")) == NULL) {
                   dobeep();
                 ewprintf("Problem opening pipe");                  ewprintf("Problem opening pipe");
                 return (NULL);                  return (NULL);
         }          }
Line 227 
Line 229 
         compile_buffer = bp;          compile_buffer = bp;
   
         if (chdir(cwd) == -1) {          if (chdir(cwd) == -1) {
                   dobeep();
                 ewprintf("Can't change dir back to %s", cwd);                  ewprintf("Can't change dir back to %s", cwd);
                 return (NULL);                  return (NULL);
         }          }
Line 296 
Line 299 
                 curwp->w_rflag |= WFMOVE;                  curwp->w_rflag |= WFMOVE;
                 goto retry;                  goto retry;
         }          }
           dobeep();
         ewprintf("No more hits");          ewprintf("No more hits");
         return (FALSE);          return (FALSE);
 }  }
Line 305 
Line 309 
 next_error(int f, int n)  next_error(int f, int n)
 {  {
         if (compile_win == NULL || compile_buffer == NULL) {          if (compile_win == NULL || compile_buffer == NULL) {
                   dobeep();
                 ewprintf("No compilation active");                  ewprintf("No compilation active");
                 return (FALSE);                  return (FALSE);
         }          }
         curwp = compile_win;          curwp = compile_win;
         curbp = compile_buffer;          curbp = compile_buffer;
         if (curwp->w_dotp == blastlp(curbp)) {          if (curwp->w_dotp == blastlp(curbp)) {
                   dobeep();
                 ewprintf("No more hits");                  ewprintf("No more hits");
                 return (FALSE);                  return (FALSE);
         }          }

Legend:
Removed from v.1.39  
changed lines
  Added in v.1.40