From a4c9f7539982d9e470ea1b0a41be6363ddf956b4 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Sun, 21 May 2006 04:09:00 +0000 Subject: [PATCH] use path-replace-suffix svn: r2994 --- collects/scribble/run-scribble.ss | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/collects/scribble/run-scribble.ss b/collects/scribble/run-scribble.ss index 012f12b96f..5ad7ae98cd 100644 --- a/collects/scribble/run-scribble.ss +++ b/collects/scribble/run-scribble.ss @@ -32,12 +32,6 @@ (render) (with-output-to-file output render 'truncate)))) - (define (no-suffix file) - (cond [(regexp-match #rx"^(.*)[.](?:[^./]*)$" - (if (path? file) (path->string file) file)) - => cadr] - [else file])) - (provide main) (define (main args) (define *output-name #f) @@ -60,8 +54,8 @@ (regexp-match #rx"[.]([^.]+)$" *output-name)) => (lambda (m) (string->symbol (cadr m)))] [else default-format])] - [output (or *output-name - (format "~a.~a" (no-suffix input-file) fmt))]) + [output (or *output-name (path-replace-suffix + input-file (symbol->string fmt)))]) (render-file input-file output fmt))])) (main (cons (symbol->string exe-name)