From: =?utf-8?b?0L3QsNCx?= <nabijaczleweli@nabijaczleweli.xyz>
Date: Sun, 23 Feb 2025 03:20:38 +0100
Subject: Replace which(1) with command -v

---
 src/festival.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/festival.c b/src/festival.c
index ea13d21..f33b22e 100644
--- a/src/festival.c
+++ b/src/festival.c
@@ -90,14 +90,14 @@ static char * snd(char * sndType) {
 
     FILE *which_pf;
     char sndserver[1024];
-    if (strcmp (sndType, "arts") == 0) 
-      which_pf= popen("which artsdsp 2>/dev/null","r");
-    else if (strcmp (sndType, "esd") == 0) 
-      which_pf= popen("which esddsp 2>/dev/null","r");
-    else if (strcmp (sndType, "alsa") == 0) 
-      which_pf= popen("which aoss 2>/dev/null","r");
-    else if (strcmp (sndType, "automatic") == 0) 
-      which_pf= popen("which artsdsp 2>/dev/null","r");
+    if (strcmp (sndType, "arts") == 0)
+      which_pf= popen("command -v artsdsp","r");
+    else if (strcmp (sndType, "esd") == 0)
+      which_pf= popen("command -v esddsp","r");
+    else if (strcmp (sndType, "alsa") == 0)
+      which_pf= popen("command -v aoss","r");
+    else if (strcmp (sndType, "automatic") == 0)
+      which_pf= popen("command -v artsdsp","r");
     fscanf(which_pf,"%1023s",sndserver);
     pclose(which_pf);
     daemon=sndserver;
@@ -518,12 +518,12 @@ static void load_conf() {
 }
 
 
-static gboolean 
+static gboolean
 plugin_load(PurplePlugin *plugin) {
 
   FILE *which_pf;
   char line[1024];
-  which_pf= popen("which festival 2>/dev/null","r");
+  which_pf= popen("command -v festival","r");
   fscanf(which_pf,"%1023s",line);
   pclose(which_pf);
 
