diff options
| author | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-06-04 22:06:41 -0800 |
|---|---|---|
| committer | David M. Syzdek <syzdek@bindlebinaries.com> | 2012-06-04 22:06:41 -0800 |
| commit | fe6e4dfa61dd74fcd73d97327558caf63097aeca (patch) | |
| tree | 842d4d0479f3d0c65f94386227587abc55f3ba64 /src | |
| parent | 938f13179d26313f8f92b7eb22ca2617bdeabe49 (diff) | |
| download | dmstools-fe6e4dfa61dd74fcd73d97327558caf63097aeca.tar.gz dmstools-fe6e4dfa61dd74fcd73d97327558caf63097aeca.tar.bz2 dmstools-fe6e4dfa61dd74fcd73d97327558caf63097aeca.tar.xz dmstools-fe6e4dfa61dd74fcd73d97327558caf63097aeca.zip | |
Updating how matches are displayed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/posixregex.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/posixregex.c b/src/posixregex.c index dae9d4a..46f6efc 100644 --- a/src/posixregex.c +++ b/src/posixregex.c | |||
| @@ -377,7 +377,10 @@ int main(int argc, char * argv[]) | |||
| 377 | if ((str_len = matches[y].rm_eo - matches[y].rm_so) > 0) | 377 | if ((str_len = matches[y].rm_eo - matches[y].rm_so) > 0) |
| 378 | { | 378 | { |
| 379 | strncpy(str, &arg[matches[y].rm_so], (size_t)str_len); | 379 | strncpy(str, &arg[matches[y].rm_so], (size_t)str_len); |
| 380 | printf(" submatch %u: %s\n", y, str); | 380 | if (!(y)) |
| 381 | printf(" full match: %s\n", str); | ||
| 382 | else | ||
| 383 | printf(" submatch %u: %s\n", y, str); | ||
| 381 | } else { | 384 | } else { |
| 382 | printf(" submatch %u:\n", y); | 385 | printf(" submatch %u:\n", y); |
| 383 | }; | 386 | }; |
