[2902] in BarnOwl Developers
Fixes to punt and filters
daemon@ATHENA.MIT.EDU (Anders Kaseorg)
Fri Feb 11 01:26:54 2011
Date: Fri, 11 Feb 2011 01:26:50 -0500 (EST)
From: Anders Kaseorg <andersk@MIT.EDU>
To: barnowl-dev@mit.edu
The following changes since commit ab9bf01ff80f13e2cfd06ee0a6a5e358bbb50727=
:
Disable special handling of START and STOP characters (^Q and ^S) (2011-0=
2-10 23:59:03 -0500)
are available in the git repository at:
git://andersk.mit.edu/barnowl.git punt
Anders Kaseorg (3):
Fix spurious error running =E2=80=98punt=E2=80=99 with no arguments
For =E2=80=98punt=E2=80=99 with one argument, quote the filter name
owl_function_classinstfilt: Do not turn [ '"] into .
commands.c | 6 ++----
functions.c | 4 ----
2 files changed, 2 insertions(+), 8 deletions(-)
-- 8< --
From=202c68a93f458221e9d6329fc89230e4ef55fa5f39 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Fri, 11 Feb 2011 00:57:52 -0500
Subject: [PATCH 1/3] Fix spurious error running =E2=80=98punt=E2=80=99 with=
no arguments
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
commands.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/commands.c b/commands.c
index 1422075..c02120b 100644
--- a/commands.c
+++ b/commands.c
@@ -2470,9 +2470,7 @@ void owl_command_punt_unpunt(int argc, const char *co=
nst * argv, const char *buf
fl =3D owl_global_get_puntlist(&g);
if(argc =3D=3D 1) {
owl_function_show_zpunts();
- }
-
- if(argc =3D=3D 2) {
+ } else if(argc =3D=3D 2) {
/* Handle :unpunt <number> */
if(unpunt && (i=3Datoi(argv[1])) !=3D0) {
i--; /* Accept 1-based indexing */
--=20
1.7.4
From=20fba2a65e9579a0c7a2206186209d9158aaec8f73 Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Fri, 11 Feb 2011 01:15:28 -0500
Subject: [PATCH 2/3] For =E2=80=98punt=E2=80=99 with one argument, quote th=
e filter name
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
commands.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/commands.c b/commands.c
index c02120b..3071171 100644
--- a/commands.c
+++ b/commands.c
@@ -2483,7 +2483,7 @@ void owl_command_punt_unpunt(int argc, const char *co=
nst * argv, const char *buf
owl_function_error("No such filter number: %d", i+1);
}
}
- text =3D owl_sprintf("filter %s", argv[1]);
+ text =3D owl_string_build_quoted("filter %q", argv[1]);
owl_function_punt(text, unpunt);
owl_free(text);
} else {
--=20
1.7.4
From=209518a859987b60867c3566157ad0a24358cd28fb Mon Sep 17 00:00:00 2001
From: Anders Kaseorg <andersk@mit.edu>
Date: Fri, 11 Feb 2011 01:15:58 -0500
Subject: [PATCH 3/3] owl_function_classinstfilt: Do not turn [ '"] into .
This transformation was not invertible, and narrowing to some
instances made it impossible to narrow to other instances that map to
the same filter name. We have already fixed most of the quoting
problems that resulted in [ '"] getting mishandled.
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
---
functions.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/functions.c b/functions.c
index 4d2eaba..fbc2bff 100644
--- a/functions.c
+++ b/functions.c
@@ -2316,10 +2316,6 @@ char *owl_function_classinstfilt(const char *c, cons=
t char *i, int related)
filtname =3D temp;
}
}
- /* turn spaces, single quotes, and double quotes into dots */
- owl_text_tr(filtname, ' ', '.');
- owl_text_tr(filtname, '\'', '.');
- owl_text_tr(filtname, '"', '.');
=20
/* if it already exists then go with it. This lets users override */
if (owl_global_get_filter(&g, filtname)) {
--=20
1.7.4