Mercurial > hg > toybox
comparison lib/xregcomp.c @ 694:786841fdb1e0
Reindent to two spaces per level. Remove vi: directives that haven't worked right in years (ubuntu broke its' vim implementation). Remove trailing spaces. Add/remove blank lines. Re-wordwrap in places. Update documentation with new coding style.
The actual code should be the same afterward, this is just cosmetic refactoring.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 13 Nov 2012 17:14:08 -0600 |
parents | 86e2bdb2ad66 |
children |
comparison
equal
deleted
inserted
replaced
693:4a5a250e0633 | 694:786841fdb1e0 |
---|---|
1 /* vi: set ts=4: | 1 /* Call regcomp() and handle errors. |
2 * Call regcomp() and handle errors. | |
3 * | 2 * |
4 * Copyright 2007 Rob Landley <rob@landley.net> | 3 * Copyright 2007 Rob Landley <rob@landley.net> |
5 * | 4 * |
6 * This is a separate file so environments that haven't got regular expression | 5 * This is a separate file so environments that haven't got regular expression |
7 * support can configure this out and avoid a build break. | 6 * support can configure this out and avoid a build break. |
10 #include "toys.h" | 9 #include "toys.h" |
11 #include "xregcomp.h" | 10 #include "xregcomp.h" |
12 | 11 |
13 void xregcomp(regex_t *preg, char *regex, int cflags) | 12 void xregcomp(regex_t *preg, char *regex, int cflags) |
14 { | 13 { |
15 int rc = regcomp(preg, regex, cflags); | 14 int rc = regcomp(preg, regex, cflags); |
16 | 15 |
17 if (rc) { | 16 if (rc) { |
18 char msg[256]; | 17 char msg[256]; |
19 regerror(rc, preg, msg, 255); | 18 regerror(rc, preg, msg, 255); |
20 msg[255]=0; | 19 msg[255]=0; |
21 error_exit("xregcomp: %s", msg); | 20 error_exit("xregcomp: %s", msg); |
22 } | 21 } |
23 } | 22 } |