summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-10-23 20:10:52 +0100
committerAndy Williams <andy@andywilliams.me>2017-10-23 20:11:22 +0100
commit8d648802e092bf3131324ba8c240abefcdca6ee8 (patch)
treee434393e7b8ad09db2f15a9b2d208a06a16484bc
parent86dea1e1d49358a60085fe662f8d309f52440262 (diff)
Use builtin string functions for comparison
-rw-r--r--src/bin/efler_main.c2
-rw-r--r--src/lib/efler.c4
-rw-r--r--src/lib/efler_config.c15
3 files changed, 8 insertions, 13 deletions
diff --git a/src/bin/efler_main.c b/src/bin/efler_main.c
index 354a9d7..e8a61ec 100644
--- a/src/bin/efler_main.c
+++ b/src/bin/efler_main.c
@@ -115,7 +115,7 @@ _efler_win_app_add(Evas_Object *list, Efler_App *app)
115 item = elm_genlist_item_append(list, &_app_class, app, NULL, 115 item = elm_genlist_item_append(list, &_app_class, app, NULL,
116 ELM_GENLIST_ITEM_NONE, _app_select, app); 116 ELM_GENLIST_ITEM_NONE, _app_select, app);
117 117
118 if (_app && !strcmp(app->id, _app->id)) 118 if (eina_streq(app->id, _app->id))
119 elm_genlist_item_selected_set(item, EINA_TRUE); 119 elm_genlist_item_selected_set(item, EINA_TRUE);
120} 120}
121 121
diff --git a/src/lib/efler.c b/src/lib/efler.c
index e6bfc00..fa8924b 100644
--- a/src/lib/efler.c
+++ b/src/lib/efler.c
@@ -258,7 +258,7 @@ efler_app_get(const char *appid)
258 Eina_List *item; 258 Eina_List *item;
259 259
260 EINA_LIST_FOREACH(efler_apps_testing_list(), item, app) 260 EINA_LIST_FOREACH(efler_apps_testing_list(), item, app)
261 if (!strcmp(appid, app->id)) 261 if (eina_streq(appid, app->id))
262 return app; 262 return app;
263 263
264 return NULL; 264 return NULL;
@@ -298,7 +298,7 @@ efler_app_current(Efler_App *app)
298 { 298 {
299 version = _efler_config_app_installed_version_get(app); 299 version = _efler_config_app_installed_version_get(app);
300 300
301 return version && !strcmp(version, app->version); 301 return version && eina_streq(version, app->version);
302 } 302 }
303 303
304 if (efler_exe_wait("[[ $(git rev-parse HEAD) == $(git rev-parse @{u}) ]]") == 0) 304 if (efler_exe_wait("[[ $(git rev-parse HEAD) == $(git rev-parse @{u}) ]]") == 0)
diff --git a/src/lib/efler_config.c b/src/lib/efler_config.c
index f20f66e..f9d1776 100644
--- a/src/lib/efler_config.c
+++ b/src/lib/efler_config.c
@@ -260,8 +260,7 @@ _efler_config_app_add(const char *id, const char *version)
260 260
261 EINA_LIST_FOREACH_SAFE(_efler_config->apps, list, next, app) 261 EINA_LIST_FOREACH_SAFE(_efler_config->apps, list, next, app)
262 { 262 {
263 if (strlen(app->id) == strlen(id) && 263 if (eina_streq(app->id, id))
264 !strncmp(app->id, id, strlen(app->id)))
265 _efler_config->apps = eina_list_remove_list(_efler_config->apps, list); 264 _efler_config->apps = eina_list_remove_list(_efler_config->apps, list);
266 } 265 }
267 266
@@ -280,8 +279,7 @@ _efler_config_app_remove(const char *id)
280 279
281 EINA_LIST_FOREACH_SAFE(_efler_config->apps, list, next, app) 280 EINA_LIST_FOREACH_SAFE(_efler_config->apps, list, next, app)
282 { 281 {
283 if (strlen(app->id) == strlen(id) && 282 if (eina_streq(app->id, id))
284 !strncmp(app->id, id, strlen(app->id)))
285 break; 283 break;
286 } 284 }
287 285
@@ -301,8 +299,7 @@ _efler_config_app_installed_get(Efler_App *app)
301 299
302 EINA_LIST_FOREACH(_efler_config->apps, list, item) 300 EINA_LIST_FOREACH(_efler_config->apps, list, item)
303 { 301 {
304 if (strlen(item->id) == strlen(app->id) && 302 if (eina_streq(item->id, app->id))
305 !strncmp(item->id, app->id, strlen(item->id)))
306 return EINA_TRUE; 303 return EINA_TRUE;
307 } 304 }
308 305
@@ -317,8 +314,7 @@ _efler_config_app_installed_version_get(Efler_App *app)
317 314
318 EINA_LIST_FOREACH(_efler_config->apps, list, item) 315 EINA_LIST_FOREACH(_efler_config->apps, list, item)
319 { 316 {
320 if (strlen(item->id) == strlen(app->id) && 317 if (eina_streq(item->id, app->id))
321 !strncmp(item->id, app->id, strlen(item->id)))
322 return item->version; 318 return item->version;
323 } 319 }
324 320
@@ -336,8 +332,7 @@ _efler_config_app_installed_version_set(Efler_App *app)
336 332
337 EINA_LIST_FOREACH(_efler_config->apps, list, item) 333 EINA_LIST_FOREACH(_efler_config->apps, list, item)
338 { 334 {
339 if (strlen(item->id) != strlen(app->id) || 335 if (!eina_streq(item->id, app->id))
340 strncmp(item->id, app->id, strlen(item->id)))
341 continue; 336 continue;
342 337
343 item->version = eina_stringshare_add(app->version); 338 item->version = eina_stringshare_add(app->version);