Module Name:    src
Committed By:   mlelstv
Date:           Sun Aug 21 07:51:31 UTC 2022

Modified Files:
        src/sbin/drvctl: drvctl.c

Log Message:
When extracting properties, don't bail for non-existent or invalid path
elements, but continue with next properry.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sbin/drvctl/drvctl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/drvctl/drvctl.c
diff -u src/sbin/drvctl/drvctl.c:1.21 src/sbin/drvctl/drvctl.c:1.22
--- src/sbin/drvctl/drvctl.c:1.21	Thu Jun 11 13:49:57 2020
+++ src/sbin/drvctl/drvctl.c	Sun Aug 21 07:51:30 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: drvctl.c,v 1.21 2020/06/11 13:49:57 thorpej Exp $ */
+/* $NetBSD: drvctl.c,v 1.22 2022/08/21 07:51:30 mlelstv Exp $ */
 
 /*
  * Copyright (c) 2004
@@ -230,17 +230,20 @@ extract_property(prop_dictionary_t dict,
 		case PROP_TYPE_DICTIONARY:
 			obj = prop_dictionary_get(obj, cur);
 			if (obj == NULL)
-				exit(EXIT_FAILURE);
+				p = NULL;
 			break;
 		case PROP_TYPE_ARRAY:
 			ind = strtoul(cur, NULL, 0);
 			obj = prop_array_get(obj, ind);
 			if (obj == NULL)
-				exit(EXIT_FAILURE);
+				p = NULL;
 			break;
 		default:
-			errx(EXIT_FAILURE, "Select neither dict nor array with"
-			" `%s'", cur);
+			fprintf(stderr, "Select neither dict nor array with"
+			    " `%s'\n", cur);
+			obj = NULL;
+			p = NULL;
+			break;
 		}
 	}
 

Reply via email to