Adding whitespace trimming around the URL used in Install .plt file...
svn: r11097
This commit is contained in:
parent
40056b3d62
commit
cfdb51a745
|
@ -376,11 +376,21 @@
|
||||||
(cond
|
(cond
|
||||||
[cancel? (void)]
|
[cancel? (void)]
|
||||||
[(from-web?)
|
[(from-web?)
|
||||||
(install-plt-from-url (send url-text-field get-value) parent)]
|
(install-plt-from-url (trim-whitespace (send url-text-field get-value)) parent)]
|
||||||
[else
|
[else
|
||||||
(parameterize ([error-display-handler drscheme:init:original-error-display-handler])
|
(parameterize ([error-display-handler drscheme:init:original-error-display-handler])
|
||||||
(run-installer (string->path (send file-text-field get-value))))]))
|
(run-installer (string->path (send file-text-field get-value))))]))
|
||||||
|
|
||||||
|
;; trim-whitespace: string -> string
|
||||||
|
;; Trims the whitespace surrounding a string.
|
||||||
|
(define (trim-whitespace a-str)
|
||||||
|
(cond
|
||||||
|
[(regexp-match #px"^\\s*(.*[^\\s])\\s*$"
|
||||||
|
a-str)
|
||||||
|
=> second]
|
||||||
|
[else
|
||||||
|
a-str]))
|
||||||
|
|
||||||
;; install-plt-from-url : string (union #f dialog%) -> void
|
;; install-plt-from-url : string (union #f dialog%) -> void
|
||||||
;; downloads and installs a .plt file from the given url
|
;; downloads and installs a .plt file from the given url
|
||||||
(define (install-plt-from-url s-url parent)
|
(define (install-plt-from-url s-url parent)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user