blob: d57a4bce970a48bd9dfdca59005496a8262a7553 (
plain)
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
47
|
From http://code.call-cc.org/cgi-bin/gitweb.cgi?p=chicken-core.git;a=commit;h=58684f69572453acc6fed7326fa9df39be98760e
--- chicken-4.8.0.3/setup-api.scm
+++ chicken-4.8.0.3/setup-api.scm
@@ -239,7 +239,7 @@
(cond ((string=? prg "csc")
(string-intersperse
(cons*
- (shellpath (find-program "csc"))
+ (find-program "csc")
"-feature" "compiling-extension"
(if (or (deployment-mode)
(and (feature? #:cross-chicken)
--- chicken-4.8.0.3/utils.scm
+++ chicken-4.8.0.3/utils.scm
@@ -59,20 +59,18 @@
;;; Quote string for shell
(define (qs str #!optional (platform (build-platform)))
- (case platform
- ((mingw32)
- (string-append "\"" str "\""))
- (else
- (if (zero? (string-length str))
- "''"
- (string-concatenate
- (map (lambda (c)
- (if (or (char-whitespace? c)
- (memq c '(#\# #\" #\' #\` #\� #\~ #\& #\% #\$ #\! #\* #\;
- #\< #\> #\\ #\( #\) #\[ #\] #\{ #\} #\?)))
- (string #\\ c)
- (string c)))
- (string->list str)))))))
+ (let ((delim (if (eq? platform 'mingw32) #\" #\'))
+ (escaped (if (eq? platform 'mingw32) "\"\"" "'\\''")))
+ (string-append
+ (string delim)
+ (string-concatenate
+ (map (lambda (c)
+ (cond
+ ((char=? c delim) escaped)
+ ((char=? c #\nul) (error 'qs "NUL character can not be represented in shell string" str))
+ (else (string c))))
+ (string->list str)))
+ (string delim))))
;;; Compile and load file
|