2022-12-08 17:22:23 +08:00
|
|
|
|
From 1f10d92214e3f6f23b8d00dccafb5ad57856fbbd Mon Sep 17 00:00:00 2001
|
2022-08-30 10:29:36 +08:00
|
|
|
|
From: Sergey Poznyakoff <gray@gnu.org>
|
|
|
|
|
|
Date: Sat, 18 Jun 2022 17:35:35 +0300
|
2022-12-08 17:22:23 +08:00
|
|
|
|
Subject: [PATCH] Fix https://puszcza.gnu.org.ua/bugs/index.php?563
|
2022-08-30 10:29:36 +08:00
|
|
|
|
|
|
|
|
|
|
---
|
2022-12-08 17:22:23 +08:00
|
|
|
|
tools/gdbmshell.c | 9 +++++++--
|
2022-08-30 10:29:36 +08:00
|
|
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
2022-12-08 17:22:23 +08:00
|
|
|
|
diff --git a/tools/gdbmshell.c b/tools/gdbmshell.c
|
|
|
|
|
|
index 20c6ea9..1f61b5b 100644
|
|
|
|
|
|
--- a/tools/gdbmshell.c
|
|
|
|
|
|
+++ b/tools/gdbmshell.c
|
|
|
|
|
|
@@ -1328,6 +1328,7 @@ snapshot_handler (struct command_param *param, struct command_environ *cenv)
|
2022-08-30 10:29:36 +08:00
|
|
|
|
char *sb = tildexpand (PARAM_STRING (param, 1));
|
|
|
|
|
|
char const *sel;
|
|
|
|
|
|
int rc = gdbm_latest_snapshot (sa, sb, &sel);
|
|
|
|
|
|
+ int res;
|
|
|
|
|
|
|
|
|
|
|
|
if (rc >= 0 && rc < ARRAY_SIZE (snapshot_status_info))
|
|
|
|
|
|
{
|
2022-12-08 17:22:23 +08:00
|
|
|
|
@@ -1339,13 +1340,17 @@ snapshot_handler (struct command_param *param, struct command_environ *cenv)
|
2022-08-30 10:29:36 +08:00
|
|
|
|
snapshot_status_info[rc].fn (cenv->fp, sa, sb);
|
|
|
|
|
|
if (rc == GDBM_SNAPSHOT_OK)
|
|
|
|
|
|
print_snapshot (sel, cenv->fp);
|
|
|
|
|
|
+ res = GDBMSHELL_OK;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
terror (_("unexpected error code: %d"), rc);
|
|
|
|
|
|
- return GDBMSHELL_ERR;
|
|
|
|
|
|
+ res = GDBMSHELL_ERR;
|
|
|
|
|
|
}
|
|
|
|
|
|
- return GDBMSHELL_OK;
|
|
|
|
|
|
+
|
|
|
|
|
|
+ free (sa);
|
|
|
|
|
|
+ free (sb);
|
|
|
|
|
|
+ return res;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
--
|
2022-12-08 17:22:23 +08:00
|
|
|
|
2.33.0
|
2022-08-30 10:29:36 +08:00
|
|
|
|
|