[vte/vte-0-34] emulation: Allow unsetting the current-{directory, file}-uri
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/vte-0-34] emulation: Allow unsetting the current-{directory, file}-uri
- Date: Sat, 1 Jun 2013 17:08:52 +0000 (UTC)
commit 89f6741d8e0ce481b7ec188043e26488edb5a455
Author: Christian Persch <chpe gnome org>
Date: Sat Jun 1 19:07:55 2013 +0200
emulation: Allow unsetting the current-{directory,file}-uri
By passing "" (or an invalid, non-URI value), unset the property.
src/vteseq.c | 32 ++++++++++++++++++--------------
1 files changed, 18 insertions(+), 14 deletions(-)
---
diff --git a/src/vteseq.c b/src/vteseq.c
index 6a60bcd..efd28ac 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -2564,13 +2564,15 @@ vte_sequence_handler_set_current_directory_uri (VteTerminal *terminal, GValueArr
}
/* Validate URI */
- filename = g_filename_from_uri (uri, NULL, NULL);
- if (filename == NULL) {
- /* invalid URI */
- g_free (uri);
- uri = NULL;
- } else {
- g_free (filename);
+ if (uri && uri[0]) {
+ filename = g_filename_from_uri (uri, NULL, NULL);
+ if (filename == NULL) {
+ /* invalid URI */
+ g_free (uri);
+ uri = NULL;
+ } else {
+ g_free (filename);
+ }
}
g_free(terminal->pvt->current_directory_uri_changed);
@@ -2596,13 +2598,15 @@ vte_sequence_handler_set_current_file_uri (VteTerminal *terminal, GValueArray *p
}
/* Validate URI */
- filename = g_filename_from_uri (uri, NULL, NULL);
- if (filename == NULL) {
- /* invalid URI */
- g_free (uri);
- uri = NULL;
- } else {
- g_free (filename);
+ if (uri && uri[0]) {
+ filename = g_filename_from_uri (uri, NULL, NULL);
+ if (filename == NULL) {
+ /* invalid URI */
+ g_free (uri);
+ uri = NULL;
+ } else {
+ g_free (filename);
+ }
}
g_free(terminal->pvt->current_file_uri_changed);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]