Skip to content

Commit

Permalink
pivy-agent: don't call basename again on the same string to detect no…
Browse files Browse the repository at this point in the history
…tify-send

doesn't really work very well, since basename modifies the string
  • Loading branch information
arekinath committed Nov 21, 2023
1 parent 9182c7d commit 50c106c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pivy-agent.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,9 +897,10 @@ try_confirm_client(socket_entry_t *e, enum piv_slotid slotid)

if (confirm != NULL) {
char *tmp = strdup(confirm);
if (strcmp(basename(tmp), "zenity") == 0)
const char *execname = basename(tmp);
if (strcmp(execname, "zenity") == 0)
add_zenity_args = B_TRUE;
if (strcmp(basename(tmp), "notify-send") == 0)
if (strcmp(execname, "notify-send") == 0)
add_notify_send_args = B_TRUE;
free(tmp);
}
Expand Down

0 comments on commit 50c106c

Please sign in to comment.