summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-15 16:06:17 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-15 16:06:17 +0200
commit79c8c90256f184be8c1a7313e946cd64c2a8e065 (patch)
treef42980eda3ddb3b1496dd7fa0a50622491404cbb /src/gui
parent3412b71959977ca65b29e43eb741e652f5292e3e (diff)
downloadweechat-79c8c90256f184be8c1a7313e946cd64c2a8e065.zip
Fix bug with buffer name in "/bar scroll" command
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/gui-buffer.c28
-rw-r--r--src/gui/gui-buffer.h1
2 files changed, 29 insertions, 0 deletions
diff --git a/src/gui/gui-buffer.c b/src/gui/gui-buffer.c
index 4462458b8..f62fc4b2c 100644
--- a/src/gui/gui-buffer.c
+++ b/src/gui/gui-buffer.c
@@ -1562,6 +1562,34 @@ gui_buffer_search_by_name (const char *plugin, const char *name)
}
/*
+ * gui_buffer_search_by_full_name: search a buffer by full name
+ * (example: "irc.freenode.#weechat")
+ */
+
+struct t_gui_buffer *
+gui_buffer_search_by_full_name (const char *full_name)
+{
+ struct t_gui_buffer *ptr_buffer;
+ char *name, *pos;
+
+ ptr_buffer = NULL;
+
+ name = strdup (full_name);
+ if (name)
+ {
+ pos = strchr (name, '.');
+ if (pos)
+ {
+ pos[0] = '\0';
+ ptr_buffer = gui_buffer_search_by_name (name, pos + 1);
+ }
+ free (name);
+ }
+
+ return ptr_buffer;
+}
+
+/*
* gui_buffer_search_by_partial_name: search a buffer by name (may be partial)
*/
diff --git a/src/gui/gui-buffer.h b/src/gui/gui-buffer.h
index fbe8c4afb..b296d2d58 100644
--- a/src/gui/gui-buffer.h
+++ b/src/gui/gui-buffer.h
@@ -244,6 +244,7 @@ extern void gui_buffer_add_value_num_displayed (struct t_gui_buffer *buffer,
extern struct t_gui_buffer *gui_buffer_search_main ();
extern struct t_gui_buffer *gui_buffer_search_by_name (const char *plugin,
const char *name);
+extern struct t_gui_buffer *gui_buffer_search_by_full_name (const char *full_name);
extern struct t_gui_buffer *gui_buffer_search_by_partial_name (const char *plugin,
const char *name);
extern struct t_gui_buffer *gui_buffer_search_by_number (int number);