user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
* [PATCH] avoid wrong/needless squote_maybe shortcuts
@ 2021-04-18  8:31 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2021-04-18  8:31 UTC (permalink / raw)
  To: meta

We'll keep it in PublicInbox::Config for now, since I'm not
sure if there's a better place to put it.
---
 lib/PublicInbox/LeiSavedSearch.pm | 4 +---
 t/reply.t                         | 5 +++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm
index f40fe76b..3076d14c 100644
--- a/lib/PublicInbox/LeiSavedSearch.pm
+++ b/lib/PublicInbox/LeiSavedSearch.pm
@@ -13,8 +13,6 @@ use PublicInbox::Spawn qw(run_die);
 use PublicInbox::ContentHash qw(git_sha);
 use Digest::SHA qw(sha256_hex);
 
-*squote_maybe = \&PublicInbox::Config::squote_maybe;
-
 # move this to PublicInbox::Config if other things use it:
 my %cquote = ("\n" => '\\n', "\t" => '\\t', "\b" => '\\b');
 sub cquote_val ($) { # cf. git-config(1)
@@ -61,7 +59,7 @@ sub new {
 		$self->{-cfg} = {};
 		my $f = $self->{'-f'} = "$dir/lei.saved-search";
 		open my $fh, '>', $f or return $lei->fail("open $f: $!");
-		my $sq_dst = squote_maybe($dst);
+		my $sq_dst = PublicInbox::Config::squote_maybe($dst);
 		my $q = $lei->{mset_opt}->{q_raw} // die 'BUG: {q_raw} missing';
 		if (ref $q) {
 			$q = join("\n", map { "\tq = ".cquote_val($_) } @$q);
diff --git a/t/reply.t b/t/reply.t
index 1e89973e..41d72db2 100644
--- a/t/reply.t
+++ b/t/reply.t
@@ -1,8 +1,9 @@
+#!perl -w
 # Copyright (C) 2017-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
-use warnings;
 use Test::More;
+use PublicInbox::Config;
 use PublicInbox::Eml;
 use_ok 'PublicInbox::Reply';
 
@@ -15,7 +16,7 @@ my @q = (
 while (@q) {
 	my $input = shift @q;
 	my $expect = shift @q;
-	my $res = PublicInbox::Reply::squote_maybe($input);
+	my $res = PublicInbox::Config::squote_maybe($input);
 	is($res, $expect, "quote $input => $res");
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-18  8:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-18  8:31 [PATCH] avoid wrong/needless squote_maybe shortcuts Eric Wong

user/dev discussion of public-inbox itself

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 meta meta/ https://public-inbox.org/meta \
		meta@public-inbox.org
	public-inbox-index meta

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.mail.public-inbox.meta
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.mail.public-inbox.meta
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.io/gmane.mail.public-inbox.general
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/public-inbox.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git