Hello,

Here's a simple patch to enable extended regular expressions for pgrep/pkill.

Thanks!

Wade
>From acc7fe448f45fb955a125dc6c1fa4044c303dafb Mon Sep 17 00:00:00 2001
From: Wade Berrier <[email protected]>
Date: Wed, 8 Jun 2011 15:46:55 -0600
Subject: [PATCH] pkill/pgrep: support extended regular expressions

Done by enabling the REG_EXTENDED and REG_NOSUB regex flags,
which also increases compatibility with the procps versions.

Signed-off-by: Wade Berrier <[email protected]>
---
 procps/pgrep.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/procps/pgrep.c b/procps/pgrep.c
index 156b4ad..dc7ffff 100644
--- a/procps/pgrep.c
+++ b/procps/pgrep.c
@@ -128,7 +128,7 @@ int pgrep_main(int argc UNUSED_PARAM, char **argv)
 		bb_show_usage();
 
 	if (argv[0])
-		xregcomp(&re_buffer, argv[0], 0);
+		xregcomp(&re_buffer, argv[0], REG_EXTENDED | REG_NOSUB);
 
 	matched_pid = 0;
 	cmd_last = NULL;
-- 
1.7.0.4

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to