/[global]/global/global/global.c
ViewVC logotype

Diff of /global/global/global.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.109 by shigio, Thu Oct 20 11:04:04 2005 UTC revision 1.110 by shigio, Thu Oct 20 15:38:49 2005 UTC
# Line 659  idutils(const char *pattern, const char Line 659  idutils(const char *pattern, const char
659          char edit[IDENTLEN+1];          char edit[IDENTLEN+1];
660          const char *path, *lno, *lid;          const char *path, *lno, *lid;
661          int linenum, count;          int linenum, count;
662          char *p, *line;          char *p, *grep;
663    
664          lid = usable("lid");          lid = usable("lid");
665          if (!lid)          if (!lid)
# Line 670  idutils(const char *pattern, const char Line 670  idutils(const char *pattern, const char
670          ffformat(edit, sizeof(edit), pattern);          ffformat(edit, sizeof(edit), pattern);
671          /*          /*
672           * make lid command line.           * make lid command line.
673             * Invoke lid with the --result=grep option to generate grep format.
674           */           */
675          strbuf_puts(ib, lid);          strbuf_puts(ib, lid);
676          strbuf_puts(ib, " --separator=newline");          strbuf_puts(ib, " --separator=newline");
# Line 692  idutils(const char *pattern, const char Line 693  idutils(const char *pattern, const char
693          if (!(op = openfilter()))          if (!(op = openfilter()))
694                  die("cannot open output filter.");                  die("cannot open output filter.");
695          count = 0;          count = 0;
696          while ((line = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) {          while ((grep = strbuf_fgets(ib, ip, STRBUF_NOCRLF)) != NULL) {
697                  p = line;                  p = grep;
698                  /* extract filename */                  /* extract filename */
699                  path = p;                  path = p;
700                  while (*p && *p != ':')                  while (*p && *p != ':')
701                          p++;                          p++;
702                  if ((xflag || tflag) && !*p)                  if ((xflag || tflag) && !*p)
703                          die("invalid lid(id-utils) output format. '%s'", line);                          die("invalid lid(id-utils) output format. '%s'", grep);
704                  *p++ = 0;                  *p++ = 0;
705                  if (lflag) {                  if (lflag) {
706                          if (!locatestring(path, localprefix + 2, MATCH_AT_FIRST))                          if (!locatestring(path, localprefix + 2, MATCH_AT_FIRST))
# Line 717  idutils(const char *pattern, const char Line 718  idutils(const char *pattern, const char
718                  while (*p && isdigit(*p))                  while (*p && isdigit(*p))
719                          p++;                          p++;
720                  if (*p != ':')                  if (*p != ':')
721                          die("invalid lid(id-utils) output format. '%s'", line);                          die("invalid lid(id-utils) output format. '%s'", grep);
722                  *p++ = 0;                  *p++ = 0;
723                  linenum = atoi(lno);                  linenum = atoi(lno);
724                  if (linenum <= 0)                  if (linenum <= 0)
725                          die("invalid lid(id-utils) output format. '%s'", line);                          die("invalid lid(id-utils) output format. '%s'", grep);
726                  /*                  /*
727                   * print out.                   * print out.
728                   */                   */

Legend:
Removed from v.1.109  
changed lines
  Added in v.1.110

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26