Репозитории ALT
S: | 2.5-alt0.4 |
5.1: | 1.96-alt7 |
4.1: | 1.96-alt5.M41.1 |
4.0: | 1.96-alt2.6 |
3.0: | |
+backports: | 1.96-alt0.M30.1 |
Другие репозитории
Upstream: | 1.96-beta |
Группа :: Звук
Пакет: festival
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: festival-1.96-alt-unsafe-tmp-usage.patch
Скачать
Скачать
diff --git a/festival/examples/saytime.sh b/festival/examples/saytime.sh
index 3efc2cf..c8eac1b 100644
--- a/festival/examples/saytime.sh
+++ b/festival/examples/saytime.sh
@@ -48,10 +48,13 @@
(define (get-the-time)
"Returns a list of hour and minute and second, for later processing"
- (let (date)
- (system "date | awk '{print $4}' | tr : ' ' >/tmp/saytime.tmp")
- (set! date (load "/tmp/saytime.tmp" t)) ;; loads the file unevaluated
- (system "rm /tmp/saytime.tmp")
+ (let (date tmpdir tmpfile)
+ (set! tmpdir (getenv "TMPDIR"))
+ (if (null? tmpdir) (set! tmpdir "/tmp"))
+ (set! tmpfile (string-append tmpdir "/saytime.tmp"))
+ (system (string-append "date | awk '{print $4}' | tr : ' ' >" tmpfile))
+ (set! date (load tmpfile t)) ;; loads the file unevaluated
+ (system (string-append "rm " tmpfile))
date)
)