svn commit: r226631 -
user/gabor/tre-integration/tools/test/regex/sgrep
Gabor Kovesdan
gabor at FreeBSD.org
Sat Oct 22 11:42:49 UTC 2011
Author: gabor
Date: Sat Oct 22 11:42:48 2011
New Revision: 226631
URL: http://svn.freebsd.org/changeset/base/226631
Log:
- Add a missing break
- Fix compilation on some platforms
- Turn off REG_NEWLINE by default
Modified:
user/gabor/tre-integration/tools/test/regex/sgrep/sgrep.c
Modified: user/gabor/tre-integration/tools/test/regex/sgrep/sgrep.c
==============================================================================
--- user/gabor/tre-integration/tools/test/regex/sgrep/sgrep.c Sat Oct 22 11:39:17 2011 (r226630)
+++ user/gabor/tre-integration/tools/test/regex/sgrep/sgrep.c Sat Oct 22 11:42:48 2011 (r226631)
@@ -135,12 +135,12 @@ procfile(const char *path)
ret = regexec(®ex, data, 1, &pmatch, eflags);
if (ret == REG_NOMATCH)
break;
- printf("(%ld,%ld)", pmatch.rm_so, pmatch.rm_eo);
+ printf("(%lld,%lld)", (long long)pmatch.rm_so, (long long)pmatch.rm_eo);
if (pmatch.rm_so == pmatch.rm_eo)
pmatch.rm_eo++;
st = pmatch.rm_eo;
}
- putchar(')');
+ printf(")\n");
}
int
@@ -152,7 +152,6 @@ main(int argc, char *argv[])
setlocale(LC_ALL, "");
- cflags = REG_NEWLINE;
eflags = REG_STARTEND;
while (((c = getopt(argc, argv, "e:EFNr")) != -1))
@@ -161,6 +160,7 @@ main(int argc, char *argv[])
pat = strdup(optarg);
if (pat == NULL)
return (EXIT_FAILURE);
+ break;
case 'E':
cflags |= REG_EXTENDED;
break;
More information about the svn-src-user
mailing list