Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 113690 Details for
Bug 171374
app-portage/portage-utils - Misc enhancements for qgrep
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
qgrep-01_regexp_compilation_speedup.patch
qgrep-01_regexp_compilation_speedup.patch (text/plain), 1.54 KB, created by
TGL
on 2007-03-18 19:54:26 UTC
(
hide
)
Description:
qgrep-01_regexp_compilation_speedup.patch
Filename:
MIME Type:
Creator:
TGL
Created:
2007-03-18 19:54:26 UTC
Size:
1.54 KB
patch
obsolete
>Index: qgrep.c >=================================================================== >RCS file: /var/cvsroot/gentoo-projects/portage-utils/qgrep.c,v >retrieving revision 1.17 >diff -u -r1.17 qgrep.c >--- qgrep.c 17 Mar 2007 20:53:23 -0000 1.17 >+++ qgrep.c 18 Mar 2007 12:17:22 -0000 >@@ -48,6 +48,7 @@ > char buf0[BUFSIZ]; > int reflags = REG_NOSUB; > char invert_match = 0; >+ regex_t preg; > > typedef char *(*FUNC) (char *, char *); > FUNC strfunc = (FUNC) strstr; >@@ -75,6 +76,17 @@ > if (argc == optind) > qgrep_usage(EXIT_FAILURE); > >+ if (do_regex) { >+ int ret; >+ if ((ret = regcomp(&preg, argv[optind], reflags))) { >+ char err[256]; >+ if (regerror(ret, &preg, err, sizeof(err))) >+ errf("regcomp failed: %s", err); >+ else >+ err("regcomp failed"); >+ } >+ } >+ > if (!do_eclass) { > initialize_ebuild_flat(); /* sets our pwd to $PORTDIR */ > if ((fp = fopen(CACHE_EBUILD_FILE, "r")) == NULL) >@@ -118,13 +130,13 @@ > if (do_regex == 0) { > if (( (FUNC *) (strfunc) (buf0, argv[optind])) == NULL) continue; > } else { >- if ((rematch(argv[optind], buf0, reflags)) != 0) continue; >+ if (regexec(&preg, buf0, 0, NULL, 0) != 0) continue; > } > } else { > if (do_regex == 0) { > if (( (FUNC *) (strfunc) (buf0, argv[optind])) != NULL) continue; > } else { >- if ((rematch(argv[optind], buf0, reflags)) == 0) continue; >+ if (regexec(&preg, buf0, 0, NULL, 0) == 0) continue; > } > } > >@@ -149,6 +161,8 @@ > closedir(eclass_dir); > else > fclose(fp); >+ if (do_regex) >+ regfree(&preg); > return EXIT_SUCCESS; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 171374
: 113690 |
113693
|
113695
|
113697
|
113698
|
113699
|
113701
|
114221
|
114222
|
114281
|
114282
|
114944