summaryrefslogtreecommitdiff
path: root/src/bin/termio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/termio.c')
-rw-r--r--src/bin/termio.c55
1 files changed, 21 insertions, 34 deletions
diff --git a/src/bin/termio.c b/src/bin/termio.c
index dea782e..2d86ea7 100644
--- a/src/bin/termio.c
+++ b/src/bin/termio.c
@@ -6,6 +6,7 @@
6#include "termio.h" 6#include "termio.h"
7#include "termiolink.h" 7#include "termiolink.h"
8#include "termpty.h" 8#include "termpty.h"
9#include "backlog.h"
9#include "termptyops.h" 10#include "termptyops.h"
10#include "termcmd.h" 11#include "termcmd.h"
11#include "termptydbl.h" 12#include "termptydbl.h"
@@ -175,11 +176,8 @@ termio_user_title_set(Evas_Object *obj, const char *title)
175 size_t len = 0; 176 size_t len = 0;
176 EINA_SAFETY_ON_NULL_RETURN(sd); 177 EINA_SAFETY_ON_NULL_RETURN(sd);
177 178
178 if (sd->pty->prop.user_title) 179 eina_stringshare_del(sd->pty->prop.user_title);
179 { 180 sd->pty->prop.user_title = NULL;
180 eina_stringshare_del(sd->pty->prop.user_title);
181 sd->pty->prop.user_title = NULL;
182 }
183 181
184 if (title) 182 if (title)
185 { 183 {
@@ -408,7 +406,7 @@ termio_config_update(Evas_Object *obj)
408 406
409 EINA_SAFETY_ON_NULL_RETURN(sd); 407 EINA_SAFETY_ON_NULL_RETURN(sd);
410 408
411 if (sd->font.name) eina_stringshare_del(sd->font.name); 409 eina_stringshare_del(sd->font.name);
412 sd->font.name = NULL; 410 sd->font.name = NULL;
413 411
414 if (sd->config->font.bitmap) 412 if (sd->config->font.bitmap)
@@ -871,11 +869,8 @@ _lost_selection(void *data, Elm_Sel_Type selection)
871 } 869 }
872 if (sd->have_sel) 870 if (sd->have_sel)
873 { 871 {
874 if (sd->sel_str) 872 eina_stringshare_del(sd->sel_str);
875 { 873 sd->sel_str = NULL;
876 eina_stringshare_del(sd->sel_str);
877 sd->sel_str = NULL;
878 }
879 termio_sel_set(sd, EINA_FALSE); 874 termio_sel_set(sd, EINA_FALSE);
880 elm_object_cnp_selection_clear(sd->win, selection); 875 elm_object_cnp_selection_clear(sd->win, selection);
881 termio_smart_update_queue(sd); 876 termio_smart_update_queue(sd);
@@ -905,7 +900,7 @@ termio_take_selection_text(Termio *sd, Elm_Sel_Type type, const char *text)
905 elm_cnp_selection_loss_callback_set(sd->win, type, 900 elm_cnp_selection_loss_callback_set(sd->win, type,
906 _lost_selection, sd->self); 901 _lost_selection, sd->self);
907 sd->have_sel = EINA_TRUE; 902 sd->have_sel = EINA_TRUE;
908 if (sd->sel_str) eina_stringshare_del(sd->sel_str); 903 eina_stringshare_del(sd->sel_str);
909 sd->sel_str = text; 904 sd->sel_str = text;
910} 905}
911 906
@@ -1043,8 +1038,7 @@ _getsel_cb(void *data,
1043 int prev_i = i; 1038 int prev_i = i;
1044 g = eina_unicode_utf8_next_get(s, &i); 1039 g = eina_unicode_utf8_next_get(s, &i);
1045 /* Skip escape codes as a security measure */ 1040 /* Skip escape codes as a security measure */
1046 if ((g < '\n') || 1041 if (! ((g == '\t') || (g == '\n') || (g >= ' ')))
1047 ((g > '\n') && (g < ' ')))
1048 { 1042 {
1049 continue; 1043 continue;
1050 } 1044 }
@@ -1074,9 +1068,9 @@ _getsel_cb(void *data,
1074 const char *fmt = "UNKNOWN"; 1068 const char *fmt = "UNKNOWN";
1075 switch (ev->format) 1069 switch (ev->format)
1076 { 1070 {
1077 case ELM_SEL_FORMAT_TARGETS: fmt = "TARGETS"; break; /* shouldn't happen */ 1071 case ELM_SEL_FORMAT_TARGETS: fmt = "TARGETS"; break;
1078 case ELM_SEL_FORMAT_NONE: fmt = "NONE"; break; 1072 case ELM_SEL_FORMAT_NONE: fmt = "NONE"; break;
1079 case ELM_SEL_FORMAT_TEXT: fmt = "TEXT"; break; 1073 case ELM_SEL_FORMAT_TEXT: fmt = "TEXT"; break; /* shouldn't happen */
1080 case ELM_SEL_FORMAT_MARKUP: fmt = "MARKUP"; break; 1074 case ELM_SEL_FORMAT_MARKUP: fmt = "MARKUP"; break;
1081 case ELM_SEL_FORMAT_IMAGE: fmt = "IMAGE"; break; 1075 case ELM_SEL_FORMAT_IMAGE: fmt = "IMAGE"; break;
1082 case ELM_SEL_FORMAT_VCARD: fmt = "VCARD"; break; 1076 case ELM_SEL_FORMAT_VCARD: fmt = "VCARD"; break;
@@ -1439,11 +1433,9 @@ _remove_links(Termio *sd)
1439{ 1433{
1440 Eina_Bool same_geom = EINA_FALSE; 1434 Eina_Bool same_geom = EINA_FALSE;
1441 1435
1442 if (sd->link.string) 1436 eina_stringshare_del(sd->link.string);
1443 { 1437 sd->link.string = NULL;
1444 eina_stringshare_del(sd->link.string); 1438
1445 sd->link.string = NULL;
1446 }
1447 sd->link.x1 = -1; 1439 sd->link.x1 = -1;
1448 sd->link.y1 = -1; 1440 sd->link.y1 = -1;
1449 sd->link.x2 = -1; 1441 sd->link.x2 = -1;
@@ -2383,8 +2375,7 @@ _smart_mouseover_apply(Termio *sd)
2383 goto end; 2375 goto end;
2384 } 2376 }
2385 2377
2386 if (sd->link.string) 2378 eina_stringshare_del(sd->link.string);
2387 eina_stringshare_del(sd->link.string);
2388 sd->link.string = eina_stringshare_add(s); 2379 sd->link.string = eina_stringshare_add(s);
2389 2380
2390 if ((x1 == sd->link.x1) && (y1 == sd->link.y1) && 2381 if ((x1 == sd->link.x1) && (y1 == sd->link.y1) &&
@@ -2829,13 +2820,13 @@ termio_file_send_ok(const Evas_Object *obj, const char *file)
2829 sd->sendfile.f = fopen(file, "w"); 2820 sd->sendfile.f = fopen(file, "w");
2830 if (sd->sendfile.f) 2821 if (sd->sendfile.f)
2831 { 2822 {
2832 if (sd->sendfile.file) eina_stringshare_del(sd->sendfile.file); 2823 eina_stringshare_del(sd->sendfile.file);
2833 sd->sendfile.file = eina_stringshare_add(file); 2824 sd->sendfile.file = eina_stringshare_add(file);
2834 sd->sendfile.active = EINA_TRUE; 2825 sd->sendfile.active = EINA_TRUE;
2835 termpty_write(ty, "k\n", 2); 2826 termpty_write(ty, "k\n", 2);
2836 return EINA_TRUE; 2827 return EINA_TRUE;
2837 } 2828 }
2838 if (sd->sendfile.file) eina_stringshare_del(sd->sendfile.file); 2829 eina_stringshare_del(sd->sendfile.file);
2839 sd->sendfile.file = NULL; 2830 sd->sendfile.file = NULL;
2840 sd->sendfile.active = EINA_FALSE; 2831 sd->sendfile.active = EINA_FALSE;
2841 termpty_write(ty, "n\n", 2); 2832 termpty_write(ty, "n\n", 2);
@@ -3226,10 +3217,9 @@ _smart_del(Evas_Object *obj)
3226 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer); 3217 if (sd->link_do_timer) ecore_timer_del(sd->link_do_timer);
3227 if (sd->mouse_move_job) ecore_job_del(sd->mouse_move_job); 3218 if (sd->mouse_move_job) ecore_job_del(sd->mouse_move_job);
3228 if (sd->mouseover_delay) ecore_timer_del(sd->mouseover_delay); 3219 if (sd->mouseover_delay) ecore_timer_del(sd->mouseover_delay);
3229 if (sd->font.name) eina_stringshare_del(sd->font.name); 3220 eina_stringshare_del(sd->font.name);
3230 if (sd->pty) termpty_free(sd->pty); 3221 if (sd->pty) termpty_free(sd->pty);
3231 if (sd->link.string) 3222 eina_stringshare_del(sd->link.string);
3232 eina_stringshare_del(sd->link.string);
3233 if (sd->glayer) evas_object_del(sd->glayer); 3223 if (sd->glayer) evas_object_del(sd->glayer);
3234 if (sd->win) 3224 if (sd->win)
3235 evas_object_event_callback_del_full(sd->win, EVAS_CALLBACK_DEL, 3225 evas_object_event_callback_del_full(sd->win, EVAS_CALLBACK_DEL,
@@ -3255,7 +3245,7 @@ _smart_del(Evas_Object *obj)
3255 } 3245 }
3256 sd->sendfile.active = EINA_FALSE; 3246 sd->sendfile.active = EINA_FALSE;
3257 } 3247 }
3258 if (sd->sel_str) eina_stringshare_del(sd->sel_str); 3248 eina_stringshare_del(sd->sel_str);
3259 if (sd->sel_reset_job) ecore_job_del(sd->sel_reset_job); 3249 if (sd->sel_reset_job) ecore_job_del(sd->sel_reset_job);
3260 EINA_LIST_FREE(sd->cur_chids, chid) eina_stringshare_del(chid); 3250 EINA_LIST_FREE(sd->cur_chids, chid) eina_stringshare_del(chid);
3261 sd->sel_str = NULL; 3251 sd->sel_str = NULL;
@@ -3800,11 +3790,8 @@ _smart_pty_command(void *data)
3800 { 3790 {
3801 sd->sendfile.progress = 0.0; 3791 sd->sendfile.progress = 0.0;
3802 sd->sendfile.size = 0; 3792 sd->sendfile.size = 0;
3803 if (sd->sendfile.file) 3793 eina_stringshare_del(sd->sendfile.file);
3804 { 3794 sd->sendfile.file = NULL;
3805 eina_stringshare_del(sd->sendfile.file);
3806 sd->sendfile.file = NULL;
3807 }
3808 if (sd->sendfile.f) 3795 if (sd->sendfile.f)
3809 { 3796 {
3810 fclose(sd->sendfile.f); 3797 fclose(sd->sendfile.f);