File: 20-shell-quoting.patch

package info (click to toggle)
gramofile 1.6-12
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,440 kB
  • sloc: ansic: 11,252; makefile: 60
file content (46 lines) | stat: -rw-r--r-- 1,946 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#Patch by Jon Schewe <jpschewe@eggplant.mtu.net>
Index: gramofile/playwav.c
===================================================================
--- gramofile.orig/playwav.c	2011-08-14 13:21:45.809217714 +0200
+++ gramofile/playwav.c	2011-08-14 13:27:14.941717336 +0200
@@ -44,11 +44,11 @@
     case FILE_EXISTS:
 
       if (usebeginendtime)
-	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 -J %ld -T %ld %s",
+	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 -J %ld -T %ld \"%s\"",
 		 (long) (begintime * 44100),
 		 (long) ((endtime - begintime) * 44100), filename);
       else
-	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 %s", filename);
+	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 \"%s\"", filename);
       /* defaults for raw files (but no -r, so .wav's supply their own
          parameters) - you can even listen to executables in CD quality (: */
 
@@ -771,11 +771,11 @@
       def_prog_mode ();		/* save terminal state */
 
       if (usebeginendtime)
-	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 -J %ld -T %ld %s",
+	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 -J %ld -T %ld \"%s\"",
 		 (long) (begintime * 44100),
 		 (long) ((endtime - begintime) * 44100), filename);
       else
-	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 %s", filename);
+	sprintf (shellcmd, "bplay_gramo -S -s 44100 -b 16 \"%s\"", filename);
       /* defaults for raw files (but no -r, so .wav's supply their own
          parameters */
 
Index: gramofile/reclp_main.c
===================================================================
--- gramofile.orig/reclp_main.c	2011-08-14 13:21:45.817217244 +0200
+++ gramofile/reclp_main.c	2011-08-14 13:27:14.941717336 +0200
@@ -30,7 +30,7 @@
 
   def_prog_mode ();		/* save terminal state */
 
-  sprintf (shellcmd, "brec_gramo -S -s 44100 -b 16 -t 6000 -w %s",
+  sprintf (shellcmd, "brec_gramo -S -s 44100 -b 16 -t 6000 -w \"%s\"",
 	   filename);
   system (shellcmd);