diff --git a/basis/escape-strings/escape-strings.factor b/basis/escape-strings/escape-strings.factor index 9502fb1da0..09fe48836c 100644 --- a/basis/escape-strings/escape-strings.factor +++ b/basis/escape-strings/escape-strings.factor @@ -33,7 +33,7 @@ IN: escape-strings : escape-simplest ( str -- str' ) dup { CHAR: ' CHAR: " CHAR: \r CHAR: \n CHAR: \s } counts { - { [ dup { CHAR: ' CHAR: \r CHAR: \n CHAR: \s } values-of sum 0 = ] [ drop "'" prepend ] } + ! { [ dup { CHAR: ' CHAR: \r CHAR: \n CHAR: \s } values-of sum 0 = ] [ drop "'" prepend ] } { [ dup CHAR: " of not ] [ drop "\"" "\"" surround ] } [ drop escape-string ] - } cond ; \ No newline at end of file + } cond ; diff --git a/basis/tools/directory-to-file/directory-to-file.factor b/basis/tools/directory-to-file/directory-to-file.factor index eab46ddb8a..949a8cae6e 100644 --- a/basis/tools/directory-to-file/directory-to-file.factor +++ b/basis/tools/directory-to-file/directory-to-file.factor @@ -9,8 +9,8 @@ IN: tools.directory-to-file : file-is-binary? ( path -- ? ) binary file-contents [ 127 <= ] all? ; -: directory-to-string ( path -- string ) - normalize-path +:: directory-to-string ( path -- string ) + path normalize-path [ path-separator = ] trim-tail "/" append [ recursive-directory-files [ file-info directory? ] reject ] keep dup '[ @@ -26,8 +26,10 @@ IN: tools.directory-to-file ] with-directory [ first2 - [ escape-string "FILE: " prepend ] dip " " glue - ] map "\n\n" join ; + [ escape-simplest "FILE:: " prepend ] dip " " glue + ] map "\n\n" join + "" surround ; : directory-to-file ( path -- ) [ directory-to-string ] keep ".modern" append