aboutsummaryrefslogtreecommitdiff
path: root/remote_plot.c
diff options
context:
space:
mode:
authorXiao Pan <xyz@flylightning.xyz>2025-05-04 16:01:53 -0700
committerXiao Pan <xyz@flylightning.xyz>2025-05-04 16:01:53 -0700
commit653e7322ee755c92bbd168e2f455d55c1c8a09d9 (patch)
tree5b09a44c1e931023c885977067e0aa482db44695 /remote_plot.c
parentde56a83c3cd8689bc2e192df007be9beb60f3731 (diff)
no need sftp_expand_path, current dir is home dir
Diffstat (limited to 'remote_plot.c')
-rw-r--r--remote_plot.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/remote_plot.c b/remote_plot.c
index b5db6d8..1235218 100644
--- a/remote_plot.c
+++ b/remote_plot.c
@@ -261,7 +261,6 @@ typedef struct {
char *filename;
// only read from local .csv file or not
bool local;
- bool dest_changed;
}DATA;
static gboolean read_data(gpointer user_data)
@@ -324,11 +323,9 @@ static gboolean read_data(gpointer user_data)
// This is to represent a loop over time
// Let's try a random walk process
- // old libssh seems does not have sftp_expand_path
- if(data->dest_changed)
- file = sftp_open(data->sftp, sftp_expand_path(data->sftp,"~/.local/share/mycan.csv"), access_type, 0);
- else
- file = sftp_open(data->sftp, "/home/Spartan_Racing_Charger/.local/share/mycan.csv", access_type, 0);
+ // No need `sftp_expand_path(data->sftp,"~/.local/share/mycan.csv")` because the current dir seems is home dir.
+ // Also old libssh seems does not have sftp_expand_path
+ file = sftp_open(data->sftp, ".local/share/mycan.csv", access_type, 0);
if (file == NULL) {
fprintf(stderr, "Can't open file for reading: %s\n",
ssh_get_error(data->session));
@@ -783,7 +780,7 @@ static int command_line (GApplication *app, GApplicationCommandLine *cmdline, gp
char *dest="Spartan_Racing_Charger@10.0.0.9";
// https://docs.gtk.org/glib/gvariant-format-strings.html#pointers
// &s copy the pointer
- data->dest_changed = g_variant_dict_lookup (options, "destination", "&s", &dest);
+ g_variant_dict_lookup (options, "destination", "&s", &dest);
g_variant_dict_lookup (options, "local", "b", &data->local);
if(!(data->local))