From 44112833b3fa7f4d7e43708e5996782e22bb2fa3 Mon Sep 17 00:00:00 2001 From: Joe Wreschnig Date: Sun, 27 May 2018 14:40:19 +0200 Subject: [PATCH 1/1] =?utf8?q?Correctly=20handle=20entries=20with=20?= =?utf8?q?=E2=80=9Cempty=E2=80=9D=20suites?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit One example of such an entry is for the SBT repository at “deb https://dl.bintray.com/sbt/debian /”. --- apt-sources-list-test.el | 7 +++++++ apt-sources-list.el | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apt-sources-list-test.el b/apt-sources-list-test.el index 54a1f57..6e5dfd9 100644 --- a/apt-sources-list-test.el +++ b/apt-sources-list-test.el @@ -125,6 +125,13 @@ deb-src http://deb.test/debian stable main"))) (type "C-c C-s stable RET") (should-equal-buffer "deb http://deb.test/debian stable xxx # foo"))) +(ert-deftest apt-sources-list-test-change-suite-empty () + (with-apt-sources-list "deb http://deb.test/debian stable main # foo" + (type "C-c C-s / RET") + (should-equal-buffer "deb http://deb.test/debian / # foo") + (type "C-c C-s unstable RET M-0 C-k xxx RET") + (should-equal-buffer "deb http://deb.test/debian unstable xxx # foo"))) + (ert-deftest apt-sources-list-test-change-components () (with-apt-sources-list "deb http://deb.test/debian stable main # foo" (type "C-c C-c M-0 C-k a SPC b") diff --git a/apt-sources-list.el b/apt-sources-list.el index f5b049c..ed4c876 100644 --- a/apt-sources-list.el +++ b/apt-sources-list.el @@ -112,7 +112,7 @@ single “%s” which will be replaced with the source name." (one-or-more (not (any " \t\n#")))) (one-or-more blank) (group - (or (and (one-or-more (not (any " \t\n#"))) "/") + (or (and (zero-or-more (not (any " \t\n#"))) "/") (and (zero-or-more (not (any " \t\n#"))) (not (any " \t\n/#")) (one-or-more blank) -- 2.20.1