commit 3edc35ea8124a20581f89c1a2432afcce3c9860c
parent 5188f57331383f5cd6c0d3e6ae2235d881c65d50
Author: Naveen Narayanan <zerous@nocebo.space>
Date: Sat, 18 Sep 2021 17:02:16 +0200
Parse process id
Diffstat:
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/parser.c b/parser.c
@@ -218,6 +218,21 @@ hostname()
static int
procid()
{
+ char str[32], *k;
+ int n;
+
+ if (!word())
+ return 0;
+
+ k = strchr(token, '[');
+ n = strspn(k+1, "0123456789");
+ memcpy(str, k+1, n);
+ str[n] = '\0';
+
+ printf("procid ok: %s\n", str);
+ return 1;
+}
+
return 1;
}