All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ] tools/meshctl: Fix default directory for JSON files
@ 2018-08-19 21:30 Inga Stotland
  2018-08-20  8:01 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 3+ messages in thread
From: Inga Stotland @ 2018-08-19 21:30 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Inga Stotland

This fixes the name of default directory that contains sample JSON files.
---
 tools/meshctl.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/meshctl.c b/tools/meshctl.c
index 3e1484f61..a8468b716 100644
--- a/tools/meshctl.c
+++ b/tools/meshctl.c
@@ -1913,21 +1913,20 @@ int main(int argc, char *argv[])
 	bt_shell_set_prompt(PROMPT_OFF);
 
 	if (!mesh_config_dir) {
-		bt_shell_printf("Local config directory not provided.\n");
-		mesh_config_dir = "";
-	} else {
-		bt_shell_printf("Reading prov_db.json and local_node.json from"
-				" %s\n", mesh_config_dir);
+		printf("Local config directory not provided.\n");
+		mesh_config_dir = "mesh";
 	}
 
+	printf("Reading prov_db.json and local_node.json from"
+				" %s directory\n", mesh_config_dir);
+
 	len = strlen(mesh_config_dir);
-	if (len && mesh_config_dir[len - 1] != '/') {
+
+	if (len && mesh_config_dir[len - 1] != '/')
 		extra = 1;
-		bt_shell_printf("mesh_config_dir[%d] %s\n", len,
-						&mesh_config_dir[len - 1]);
-	} else {
+	else
 		extra = 0;
-	}
+
 	mesh_local_config_filename = g_malloc(len + strlen("local_node.json")
 									+ 2);
 	if (!mesh_local_config_filename)
@@ -1956,6 +1955,7 @@ int main(int argc, char *argv[])
 
 	sprintf(mesh_prov_db_filename, "%s", mesh_config_dir);
 	len = strlen(mesh_config_dir);
+
 	if (extra)
 		sprintf(mesh_prov_db_filename + len , "%c", '/');
 
-- 
2.14.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-21  6:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-19 21:30 [PATCH BlueZ] tools/meshctl: Fix default directory for JSON files Inga Stotland
2018-08-20  8:01 ` Luiz Augusto von Dentz
2018-08-21  6:28   ` Stotland, Inga

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.