[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.23 and 1.24

version 1.23, 2005/11/12 19:13:09 version 1.24, 2005/11/18 20:56:53
Line 39 
Line 39 
 static int       grep(int, int);  static int       grep(int, int);
 static int       compile(int, int);  static int       compile(int, int);
 static int       gid(int, int);  static int       gid(int, int);
 static BUFFER   *compile_mode(const char *, const char *, const char *);  static struct buffer    *compile_mode(const char *, const char *, const char *);
 static int       getbufcwd(char *, size_t);  static int       getbufcwd(char *, size_t);
   
 void grep_init(void);  void grep_init(void);
Line 51 
Line 51 
  *   *
  * XXX - need some kind of callback to find out when those get killed.   * XXX - need some kind of callback to find out when those get killed.
  */   */
 MGWIN   *compile_win;  struct mgwin    *compile_win;
 BUFFER  *compile_buffer;  struct buffer   *compile_buffer;
   
 static PF compile_pf[] = {  static PF compile_pf[] = {
         compile_goto_error          compile_goto_error
Line 84 
Line 84 
 {  {
         char     command[NFILEN + 20];          char     command[NFILEN + 20];
         char     prompt[NFILEN], *bufp;          char     prompt[NFILEN], *bufp;
         BUFFER  *bp;          struct buffer   *bp;
         MGWIN   *wp;          struct mgwin    *wp;
         char     path[NFILEN];          char     path[NFILEN];
   
         /* get buffer cwd */          /* get buffer cwd */
Line 118 
Line 118 
 {  {
         char     command[NFILEN + 20];          char     command[NFILEN + 20];
         char     prompt[NFILEN], *bufp;          char     prompt[NFILEN], *bufp;
         BUFFER  *bp;          struct buffer   *bp;
         MGWIN   *wp;          struct mgwin    *wp;
         char     path[NFILEN];          char     path[NFILEN];
   
         /* get buffer cwd */          /* get buffer cwd */
Line 157 
Line 157 
 {  {
         char     command[NFILEN + 20];          char     command[NFILEN + 20];
         char     prompt[NFILEN], c, *bufp;          char     prompt[NFILEN], c, *bufp;
         BUFFER  *bp;          struct buffer   *bp;
         MGWIN   *wp;          struct mgwin    *wp;
         int      i, j;          int      i, j;
         char     path[NFILEN];          char     path[NFILEN];
   
Line 213 
Line 213 
         return (TRUE);          return (TRUE);
 }  }
   
 BUFFER *  struct buffer *
 compile_mode(const char *name, const char *command, const char *path)  compile_mode(const char *name, const char *command, const char *path)
 {  {
         BUFFER  *bp;          struct buffer   *bp;
         FILE    *pipe;          FILE    *pipe;
         char    *buf;          char    *buf;
         size_t   len;          size_t   len;
Line 280 
Line 280 
 static int  static int
 compile_goto_error(int f, int n)  compile_goto_error(int f, int n)
 {  {
         BUFFER  *bp;          struct buffer   *bp;
         MGWIN   *wp;          struct mgwin    *wp;
         char    *fname, *line, *lp, *ln;          char    *fname, *line, *lp, *ln;
         int      lineno, len;          int      lineno, len;
         char    *adjf;          char    *adjf;
         const char *errstr;          const char *errstr;
         LINE    *last;          struct line     *last;
   
         compile_win = curwp;          compile_win = curwp;
         compile_buffer = curbp;          compile_buffer = curbp;
Line 310 
Line 310 
                 goto fail;                  goto fail;
         if ((ln = strsep(&lp, ":")) == NULL || *ln == '\0')          if ((ln = strsep(&lp, ":")) == NULL || *ln == '\0')
                 goto fail;                  goto fail;
         lineno = strtonum(ln, INT_MIN, INT_MAX, &errstr);          lineno = (int)strtonum(ln, INT_MIN, INT_MAX, &errstr);
         if (errstr)          if (errstr)
                 goto fail;                  goto fail;
   

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24