summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/pseudo/files/0002-pseudo_client-Lessen-indentation-of-pseudo_client_ig.patch
blob: e4a5356f5c7de0113943c33e0fdb6379181e1b6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From 28c760542eecd7c5b35ea88aa2b14d62afbda961 Mon Sep 17 00:00:00 2001
From: Peter Kjellerstedt <pkj@axis.com>
Date: Sat, 21 Nov 2020 17:22:38 +0100
Subject: [PATCH] pseudo_client: Lessen indentation of
 pseudo_client_ignore_path_chroot()

Change-Id: I739b18efb7a95ce2d2d907d0faf7df539ab9af1c
---
 pseudo_client.c | 45 +++++++++++++++++++++++++--------------------
 1 file changed, 25 insertions(+), 20 deletions(-)

diff --git a/pseudo_client.c b/pseudo_client.c
index 116d926..a8bc3dc 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -1527,28 +1527,33 @@ int pseudo_client_ignore_fd(int fd) {
 
 int pseudo_client_ignore_path_chroot(const char *path, int ignore_chroot) {
 	char *env;
-	if (path) {
-		if (ignore_chroot && pseudo_chroot && strncmp(path, pseudo_chroot, pseudo_chroot_len) == 0)
-			return 0;
-		env = pseudo_get_value("PSEUDO_IGNORE_PATHS");
-		if (env) {
-			char *p = env;
-        	        while (*p) {
-				char *next = strchr(p, ',');
-				if (!next)
-				    next = strchr(p, '\0');
-				if ((next - p) && !strncmp(path, p, next - p)) {
-		 			pseudo_debug(PDBGF_PATH | PDBGF_VERBOSE, "ignoring path: '%s'\n", path);
-					return 1;
-				}
-				if (next && *next != '\0')
-					p = next+1;
-				else
-					break;
-			}
-			free(env);
+
+	if (!path)
+		return 0;
+
+	if (ignore_chroot && pseudo_chroot && strncmp(path, pseudo_chroot, pseudo_chroot_len) == 0)
+		return 0;
+
+	env = pseudo_get_value("PSEUDO_IGNORE_PATHS");
+	if (!env)
+		return 0;
+
+	char *p = env;
+	while (*p) {
+		char *next = strchr(p, ',');
+		if (!next)
+			next = strchr(p, '\0');
+		if ((next - p) && !strncmp(path, p, next - p)) {
+ 			pseudo_debug(PDBGF_PATH | PDBGF_VERBOSE, "ignoring path: '%s'\n", path);
+			return 1;
 		}
+		if (next && *next != '\0')
+			p = next+1;
+		else
+			break;
 	}
+	free(env);
+
 	return 0;
 }