summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rische <leon.rische@me.com>2020-11-02 14:09:54 +0100
committerLeon Rische <leon.rische@me.com>2020-11-02 14:09:54 +0100
commit94e29c6ac8e618ddb9acc730738374eadb47ac62 (patch)
tree1d0b97ed648bc2823100da8d3f4ffdc3ac24f5a8
parent730f8461002d6562856c8f636c1b5cd7d8a2c638 (diff)
Shell quote file paths
-rw-r--r--org-fc-awk.el2
-rw-r--r--tests/escaping/spaces in filename.org12
-rw-r--r--tests/org-fc-indexer-test.el8
3 files changed, 21 insertions, 1 deletions
diff --git a/org-fc-awk.el b/org-fc-awk.el
index 9c9d89b..fce1747 100644
--- a/org-fc-awk.el
+++ b/org-fc-awk.el
@@ -31,7 +31,7 @@ a '.' to exclude temporary / backup files.
With the '-L' option, 'find' follows symlinks."
(format
"find -L %s -name \"*.org\" -not -name \".*\" -print0"
- (mapconcat 'identity paths " ")))
+ (mapconcat 'shell-quote-argument paths " ")))
(defun org-fc-awk--indexer-variables ()
"Variables to pass to indexer scripts."
diff --git a/tests/escaping/spaces in filename.org b/tests/escaping/spaces in filename.org
new file mode 100644
index 0000000..ec3fd2a
--- /dev/null
+++ b/tests/escaping/spaces in filename.org
@@ -0,0 +1,12 @@
+* Test Front :fc:
+:PROPERTIES:
+:FC_CREATED: 2020-11-02T13:07:39Z
+:FC_TYPE: normal
+:ID: 33645f3a-384d-44ed-aed2-a2d56b973800
+:END:
+:REVIEW_DATA:
+| position | ease | box | interval | due |
+|----------+------+-----+----------+----------------------|
+| front | 2.5 | 0 | 0 | 2020-11-02T13:07:39Z |
+:END:
+Test Back
diff --git a/tests/org-fc-indexer-test.el b/tests/org-fc-indexer-test.el
index 1d37529..adb00fe 100644
--- a/tests/org-fc-indexer-test.el
+++ b/tests/org-fc-indexer-test.el
@@ -14,6 +14,14 @@
(should (null (org-fc-awk-index-paths
(list (org-fc-test-fixture "malformed/unclosed_drawer2.org"))))))
+(ert-deftest org-fc-test-escaping ()
+ (let ((index (org-fc-awk-index-paths
+ (list (org-fc-test-fixture "escaping/spaces in filename.org")))))
+ (should (eq (length index) 1))
+ (should
+ (equal (plist-get (car index) :id)
+ "33645f3a-384d-44ed-aed2-a2d56b973800"))))
+
(ert-deftest org-fc-test-index ()
(let ((index (org-fc-awk-index-paths
(list