diff options
author | JengHyun Kang <jhyuni.kang@samsung.com> | 2016-08-11 11:40:01 +0900 |
---|---|---|
committer | JengHyun Kang <jhyuni.kang@samsung.com> | 2016-08-11 14:01:59 +0900 |
commit | 92757f28fc9cf7fb90bdfc290b1b97e173c30a72 (patch) | |
tree | ddc80f2f72322f9aedfe73b7de78f6e27c17aa01 | |
parent | e5fe530882c11969d12608810f9be0c6221377a7 (diff) | |
download | xkeyboard-config-92757f28fc9cf7fb90bdfc290b1b97e173c30a72.tar.gz xkeyboard-config-92757f28fc9cf7fb90bdfc290b1b97e173c30a72.tar.bz2 xkeyboard-config-92757f28fc9cf7fb90bdfc290b1b97e173c30a72.zip |
Do not duplicated xkb_name settingsubmit/tizen_3.0_wearable/20161015.000007submit/tizen_3.0_tv/20161015.000006submit/tizen_3.0_mobile/20161015.000007submit/tizen_3.0_ivi/20161010.000008submit/tizen/20160811.050953accepted/tizen/wearable/20160811.085607accepted/tizen/tv/20160811.085546accepted/tizen/mobile/20160811.085530accepted/tizen/ivi/20160811.085625accepted/tizen/common/20160811.150052accepted/tizen/3.0/wearable/20161015.084636accepted/tizen/3.0/tv/20161016.010018accepted/tizen/3.0/mobile/20161015.034406accepted/tizen/3.0/ivi/20161011.070330
Change-Id: I6f1fb02fa110bc2e730e89a9964e14b8cc96ea29
-rw-r--r-- | cache/cache.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/cache/cache.c b/cache/cache.c index cab812a3..4b79281f 100644 --- a/cache/cache.c +++ b/cache/cache.c @@ -90,31 +90,31 @@ void parseArgs(int argc, char **argv, struct xkb_rule_names *names) { res = fscanf(file, "%1023s", buf); if (res < 0) break; - if (strstr(buf, "rules") > 0) + if (!names->rules && strstr(buf, "rules") > 0) { tmp = strtok_r(buf, "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); if (tmp) names->rules= strdup(tmp); } - else if (strstr(buf, "model") > 0) + else if (!names->model && strstr(buf, "model") > 0) { tmp = strtok_r(buf, "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); if (tmp) names->model= strdup(tmp); } - else if (strstr(buf, "layout") > 0) + else if (!names->layout && strstr(buf, "layout") > 0) { tmp = strtok_r(buf, "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); if (tmp) names->layout= strdup(tmp); } - else if (strstr(buf, "variant") > 0) + else if (!names->variant && strstr(buf, "variant") > 0) { tmp = strtok_r(buf, "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); if (tmp) names->variant= strdup(tmp); } - else if (strstr(buf, "options") > 0) + else if (!names->options && strstr(buf, "options") > 0) { tmp = strtok_r(buf, "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); @@ -130,35 +130,35 @@ void parseArgs(int argc, char **argv, struct xkb_rule_names *names) { printf("Cache file rule from argument\n"); - if (strstr(argv[i], "-rules") > 0) + if (!names->rules && strstr(argv[i], "-rules") > 0) { tmp = strtok_r(argv[i], "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); - names->rules= strdup(tmp); + if (tmp) names->rules= strdup(tmp); } - else if (strstr(argv[i], "-model") > 0) + else if (!names->model && strstr(argv[i], "-model") > 0) { tmp = strtok_r(argv[i], "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); - names->model = strdup(tmp); + if (tmp) names->model = strdup(tmp); } - else if (strstr(argv[i], "-layout") > 0) + else if (!names->layout && strstr(argv[i], "-layout") > 0) { tmp = strtok_r(argv[i], "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); - names->layout = strdup(tmp); + if (tmp) names->layout = strdup(tmp); } - else if (strstr(argv[i], "-variant") > 0) + else if (!names->variant && strstr(argv[i], "-variant") > 0) { tmp = strtok_r(argv[i], "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); - names->variant = strdup(tmp); + if (tmp) names->variant = strdup(tmp); } - else if (strstr(argv[i], "-options") > 0) + else if (!names->options && strstr(argv[i], "-options") > 0) { tmp = strtok_r(argv[i], "=", &buf_ptr); tmp = strtok_r(NULL, "=", &buf_ptr); - names->options = strdup(tmp); + if (tmp) names->options = strdup(tmp); } } } @@ -198,7 +198,7 @@ int main(int argc, char **argv) { struct xkb_context *ctx; struct xkb_keymap *map; - struct xkb_rule_names names; + struct xkb_rule_names names = {0, }; char *keymap_path = NULL; char *keymap_string = NULL; char *cache_path = NULL; |