diff options
Diffstat (limited to 'src/RegExp.cc')
-rw-r--r-- | src/RegExp.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RegExp.cc b/src/RegExp.cc index 093c53f..1a47d04 100644 --- a/src/RegExp.cc +++ b/src/RegExp.cc | |||
@@ -20,9 +20,10 @@ | |||
20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 20 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
21 | // DEALINGS IN THE SOFTWARE. | 21 | // DEALINGS IN THE SOFTWARE. |
22 | 22 | ||
23 | // $Id: RegExp.cc,v 1.2 2003/06/13 11:43:46 fluxgen Exp $ | 23 | // $Id: RegExp.cc,v 1.3 2004/06/07 11:46:04 rathnor Exp $ |
24 | 24 | ||
25 | #include "RegExp.hh" | 25 | #include "RegExp.hh" |
26 | #include "FbTk/I18n.hh" | ||
26 | 27 | ||
27 | //use GNU extensions | 28 | //use GNU extensions |
28 | #ifndef _GNU_SOURCE | 29 | #ifndef _GNU_SOURCE |
@@ -37,7 +38,7 @@ using namespace std; | |||
37 | 38 | ||
38 | /******************************************************** | 39 | /******************************************************** |
39 | * RegExp * | 40 | * RegExp * |
40 | ***********/ | 41 | **********/ |
41 | 42 | ||
42 | // full_match is to say if we match on this regexp using the full string | 43 | // full_match is to say if we match on this regexp using the full string |
43 | // or just a substring. Substrings aren't supported if not HAVE_REGEXP | 44 | // or just a substring. Substrings aren't supported if not HAVE_REGEXP |
@@ -57,12 +58,13 @@ m_regex(0) { | |||
57 | int ret = regcomp(m_regex, match.c_str(), REG_NOSUB | REG_EXTENDED); | 58 | int ret = regcomp(m_regex, match.c_str(), REG_NOSUB | REG_EXTENDED); |
58 | if (ret != 0) { | 59 | if (ret != 0) { |
59 | char *errstr = 0; | 60 | char *errstr = 0; |
61 | _FB_USES_NLS; | ||
60 | // gives us the length of the string | 62 | // gives us the length of the string |
61 | unsigned int size = regerror(ret, m_regex, errstr, 0); | 63 | unsigned int size = regerror(ret, m_regex, errstr, 0); |
62 | errstr = new char[size]; | 64 | errstr = new char[size]; |
63 | 65 | ||
64 | regerror(ret, m_regex, errstr, size); | 66 | regerror(ret, m_regex, errstr, size); |
65 | cerr<<"Error parsing regular expression: "<<errstr<<endl; | 67 | cerr<<_FBTEXT(Fluxbox, ErrorRegexp, "Error parsing regular expression", "Error parsing regular expression (following)")<<": "<<errstr<<endl; |
66 | delete [] errstr; | 68 | delete [] errstr; |
67 | delete m_regex; // I don't think I regfree a failed compile? | 69 | delete m_regex; // I don't think I regfree a failed compile? |
68 | m_regex = 0; | 70 | m_regex = 0; |