search for: pcre_exec

Displaying 20 results from an estimated 73 matches for "pcre_exec".

2011 Sep 29
3
grep and PCRE fun
...I think I've found a bug in the C function do_grep located in src/main/grep.c. It seems to affect both the latest revisions of R-2-13-branch and trunk when compiling R without optimizations and with it's own version of pcre located in src/extra, at least on ubuntu 10.04. According to the pcre_exec API (I presume the later versions), the ovecsize argument must be a multiple of 3 , and the ovector argument must point to a location that can hold at least ovecsize integers. All the pcre_exec calls made by do_grep, save one, honors this. That one call seems to overwrite areas of the stack it shou...
2018 Apr 27
1
[PATCH] common/mlpcre: fix access to freed memory
...e-c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c index da982025f..0762a8341 100644 --- a/common/mlpcre/pcre-c.c +++ b/common/mlpcre/pcre-c.c @@ -207,8 +207,9 @@ guestfs_int_pcre_matches (value rev, value strv) m->r = pcre_exec (re, NULL, m->subject, len, 0, 0, m->vec, veclen); if (m->r < 0 && m->r != PCRE_ERROR_NOMATCH) { + int ret = m->r; free_last_match (m); - raise_pcre_error ("pcre_exec", m->r); + raise_pcre_error ("pcre_exec", ret); } /* This...
2002 Nov 02
5
problem compiling R-1.6.1 on WinNT: pcre
...bappl.a libmath.a ga.a gl.a xdr.a ../extra/zlib/libz.a ../extra/pcre/libRpcre.a ../extra/bzip2/libbz2.a dllversion.o -L. -lg2c -lRblas -lcomctl32 -lversion libmain.a(pcre.o)(.text+0x108):pcre.c: undefined reference to `pcre_compile' libmain.a(pcre.o)(.text+0x16e):pcre.c: undefined reference to `pcre_exec' libmain.a(pcre.o)(.text+0x19d):pcre.c: undefined reference to `pcre_free' libmain.a(pcre.o)(.text+0x499):pcre.c: undefined reference to `pcre_compile' libmain.a(pcre.o)(.text+0x4bb):pcre.c: undefined reference to `pcre_info' libmain.a(pcre.o)(.text+0x587):pcre.c: undefined referenc...
2016 Feb 23
3
[PATCH 1/2] lib: Allow the COMPILE_REGEXP macro to be used everywhere.
Since the daemon links to pcre and use regular expressions, and since the COMPILE_REGEXP macro doesn't depend on any aspects of the library-side code (eg. the guestfs_h handle etc), we can allow the daemon to use the COMPILE_REGEXP macro. Move the macro to "guestfs-internal-all.h" to permit this. --- src/guestfs-internal-all.h | 26 ++++++++++++++++++++++++++ src/guestfs-internal.h
2013 Oct 05
3
trying to compile R in win 7 (with Rtools)
...pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3784:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] connections.c:3788:4: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing] pcre_exec.c: In function 'pcre_exec': pcre_exec.c:7190:20: warning: 'match_partial' may be used uninitialized in this function [-Wuninitialized] localtime.c: In function 'timesub.isra.2': localtime.c:1407:5: warning: assuming signed overflow does not occur when assuming that (X + c)...
2016 Mar 29
2
Bite-size project
On Mar 28, 2016 3:01 PM, "Olly Betts" <olly at survex.com> wrote: > That's where a new command needs to be hooked up, but in this case I'd > put the actual implementation into transform.cc alongside the > implementation of $transform - then it can share $transform's regex > cache (which avoids recompiling a regex if it's used multiple times, > either
2016 Mar 26
2
Bite-size project
...a new command in query.cc and write the implementation for this command 2. Inside implementation, we will use pcre library in a similar way to the $tranform function and take two arguments, the regex and the string to perform a match on. 3. Then using pcre library, we check for a regex match using pcre_exec( ) and if the value it returns is lesser than or equal to zero, return true or else return false. Do let me know if I'm going wrong out here. Thanks :) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-devel/attachments...
2019 Mar 29
0
[PATCH v2 1/3] common/mlpcre: add offset flag for PCRE.matches
...rv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, value strv) caml_raise_out_of_memory (); } - m->r = pcre_exec (re, NULL, m->subject, len, 0, 0, m->vec, veclen); + m->r = pcre_exec (re, NULL, m->subject, len, Optint_val (offsetv, 0), 0, + m->vec, veclen); if (m->r < 0 && m->r != PCRE_ERROR_NOMATCH) { int ret = m->r; free_last_match (m); dif...
2019 Feb 25
0
[PATCH 1/3] common/mlpcre: add offset flag for PCRE.matches
...rv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, value strv) caml_raise_out_of_memory (); } - m->r = pcre_exec (re, NULL, m->subject, len, 0, 0, m->vec, veclen); + m->r = pcre_exec (re, NULL, m->subject, len, Optint_val (offsetv, 0), 0, + m->vec, veclen); if (m->r < 0 && m->r != PCRE_ERROR_NOMATCH) { int ret = m->r; free_last_match (m); dif...
2016 Mar 29
2
Bite-size project
...essed is a nice bonus. So duplication isn't terrible, but it is > better to try to avoid it. > I've created a new ticket and assigned it to myself. I'll also update the project ideas list and provide the link to this ticket there shortly. I'm sorry about going wrong with the pcre_exec return values. I reversed it by mistake. I'll start working on this by tomorrow and try to get it tested on my system and then stage it for a merge within this week! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.xapian.org/pipermail/xapian-dev...
2013 Jan 24
5
[PATCH] btrfs: Fix btrfs_subvolume_list on F18
...if (sscanf (line, "ID %" SCNu64 " top level %" SCNu64 " path ", - &ret->guestfs_int_btrfssubvolume_list_val[i].btrfssubvolume_id, - &ret->guestfs_int_btrfssubvolume_list_val[i].btrfssubvolume_top_level_id) != 2) { + if (pcre_exec (re, NULL, line, strlen(line), 0, 0, + ovector, N_MATCHES * 3) < 0) + #undef N_MATCHES + { unexpected_output: reply_with_error ("unexpected output from 'btrfs subvolume list' command: %s", line); free_stringslen (lines, nr_subvolumes);...
2010 Apr 19
1
[PATCH matahari] Replaces the existing HAL code for ProcessorAgent with udev.
...gexstr.c_str(), 0, &pcre_error, &pcre_error_offset, NULL); + if(!regex) { throw runtime_error("Unable to compile regular expression."); } + + while(!input.eof() && !done) + { + string line; + + getline(input, line); + int match = pcre_exec(regex, NULL, line.c_str(), line.length(), + 0, PCRE_NOTEMPTY,found, expected * 3); - int num_results; - char** processors = libhal_find_device_by_capability(context,"processor", &num_results, &dbus_error); + if(match == expected) +...
2010 Apr 19
1
[PATCH matahari] Removes all code for the previous CPUWrapper class.
...cpuinfo.is_open() || cpuinfo.fail()) - throw runtime_error("Unable to open /proc/cpuinfo"); - - // Each line is a key:value pair. New processor - // delimiter is the "processor" key. - while (!cpuinfo.eof()) { - getline(cpuinfo, line); - int match = pcre_exec(regex, // Regex - NULL, // No extra optimizations - line.c_str(), // Input - line.length(), // Input length - 0, // Start offset -...
2017 Jan 06
0
strsplit(perl=TRUE), gregexpr(perl=TRUE) very slow for long strings
...0.30 0.08 0.52 155.50 0.40 155.43 I have not looked at R's code, but it is possible that the problem is caused by PCRE repeatedly scanning (once per match) the entire input string to make sure it is valid UTF-8. If so, adding PCRE_NO_UTF8_CHECK to the flags given to pcre_exec would solve the problem. Perhaps R is already doing that in gsub(perl=TRUE). Here is the test function: regex.perf.test <- function(N=c(1e4, 2e4, 4e4, 8e4)) { makeTestString <- function(n) paste(collapse="", rep("ab", n)) s <- lapply(N, makeTestString) fns &lt...
2018 May 11
1
valgrind issue in core R 3.5
wrapped <- strwrap("raw") writeLines(wrapped) q() ==8699== Conditional jump or move depends on uninitialised value(s) ==8699== at 0x40310A9: ??? ==8699== by 0xB07F4EF: ??? ==8699== by 0xB07F4EF: ??? ==8699== by 0xB07F4F2: ??? ==8699== by 0x1FFEFFA88F: ??? ==8699==
2015 Feb 02
0
Re: [PATCH 1/2] New API: btrfs_balance_status
...; + return ret; > + } > + > + re = pcre_compile ("Balance on '.*' is (.*)", 0, &errptr, &erroffset, NULL); > + if (re == NULL) { > + reply_with_error ("pcre_compile (%i): %s", erroffset, errptr); > + goto error; > + } > + if (pcre_exec (re, NULL, lines[0], strlen (lines[0]), 0, 0, > + ovector, N_MATCH * 3) < 0) { > + reply_with_error ("unexpected output from 'btrfs balance status' command: %s", lines[0]); > + goto error; > + } > +#undef N_MATCH > + > + if (STREQ (l...
2010 Apr 21
1
[PATCH matahari] Created a new platform-abstraction layer named Platform.
...gexstr.c_str(), 0, &pcre_error, &pcre_error_offset, NULL); + if(!regex) { throw runtime_error("Unable to compile regular expression."); } + + while(!input.eof() && !done) + { + string line; + + getline(input, line); + int match = pcre_exec(regex, NULL, line.c_str(), line.length(), + 0, PCRE_NOTEMPTY,found, expected * 3); + + if(match == expected) + { + string name = line.substr(found[2], found[3] - found[2]); + string value = line.substr(found[4], found[5] -...
2016 Mar 29
2
Bite-size project
On Tue, Mar 29, 2016 at 06:20:21AM +0100, Olly Betts wrote: > > Can I start with trying to implement this? > > Sure - there's really no need to ask permission to work on something. It's probably helpful to create a ticket and claim it (and update the project ideas list to link to it), so other people don't try to work on it as well. (I have a feeling that it might have
2013 Sep 23
0
400 bad request
...%91%E1%83%98?mc=mini+aipadi&search=%E1%83%AB%E1%83%98%E1%83%94%E1%83%91%E1%83%9 I succeeded to deal when there is no get parameters (first url above) and make in that case a redirection to / when this happen, this line is added to nginx error.log 2013/09/24 00:46:53 [alert] 63547#0: *19359227 pcre_exec() failed: -10 on "/ka/განცხადებებ�" using "", client: aa.bb.cc.dd, server: gancxadebebi.ge, request: "GET /ka/%E1%83%92%E1%83%90%E1%83%9C%E1%83%AA%E1%83%AE%E1%83%90%E1%83%93%E1%83%94%E1%83%91%E1%83%94%E1%83%91%E1%8 HTTP/1.1", host: "gancxadebebi.ge" but...
2017 Sep 22
0
[PATCH v3 02/22] common/mlpcre: Add PCRE.subi to return indexes instead of the substring.
...{!matches} in the current thread. + + This is the same as {!sub} but instead of copying the + substring out, it returns the indexes into the original string + of the first character of the substring and the first + character after the substring. + + (See pcreapi(3) section "How pcre_exec() returns captured substrings" + for exact details). + + If there was no nth substring then this raises [Not_found]. *) diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c index da9b50d34..15775dad0 100644 --- a/common/mlpcre/pcre-c.c +++ b/common/mlpcre/pcre-c.c @@ -225,3 +225,...