builtin-config.c (3d886aa3be15439e05784ac1cbd4acc2f13c0048) | builtin-config.c (8e99b6d4533cf3f49dcd813155a513a5b572baef) |
---|---|
1/* 2 * builtin-config.c 3 * 4 * Copyright (C) 2015, Taeung Song <treeze.taeung@gmail.com> 5 * 6 */ 7#include "builtin.h" 8 9#include "perf.h" 10 11#include "util/cache.h" 12#include <subcmd/parse-options.h> 13#include "util/util.h" 14#include "util/debug.h" 15#include "util/config.h" | 1/* 2 * builtin-config.c 3 * 4 * Copyright (C) 2015, Taeung Song <treeze.taeung@gmail.com> 5 * 6 */ 7#include "builtin.h" 8 9#include "perf.h" 10 11#include "util/cache.h" 12#include <subcmd/parse-options.h> 13#include "util/util.h" 14#include "util/debug.h" 15#include "util/config.h" |
16#include <linux/string.h> |
|
16 17static bool use_system_config, use_user_config; 18 19static const char * const config_usage[] = { 20 "perf config [<file-option>] [options] [section.name[=value] ...]", 21 NULL 22}; 23 --- 50 unchanged lines hidden (view full) --- 74{ 75 struct perf_config_section *section; 76 struct perf_config_item *item; 77 78 if (set == NULL) 79 return -1; 80 81 perf_config_items__for_each_entry(&set->sections, section) { | 17 18static bool use_system_config, use_user_config; 19 20static const char * const config_usage[] = { 21 "perf config [<file-option>] [options] [section.name[=value] ...]", 22 NULL 23}; 24 --- 50 unchanged lines hidden (view full) --- 75{ 76 struct perf_config_section *section; 77 struct perf_config_item *item; 78 79 if (set == NULL) 80 return -1; 81 82 perf_config_items__for_each_entry(&set->sections, section) { |
82 if (prefixcmp(var, section->name) != 0) | 83 if (!strstarts(var, section->name)) |
83 continue; 84 85 perf_config_items__for_each_entry(§ion->items, item) { 86 const char *name = var + strlen(section->name) + 1; 87 88 if (strcmp(name, item->name) == 0) { 89 char *value = item->value; 90 --- 158 unchanged lines hidden --- | 84 continue; 85 86 perf_config_items__for_each_entry(§ion->items, item) { 87 const char *name = var + strlen(section->name) + 1; 88 89 if (strcmp(name, item->name) == 0) { 90 char *value = item->value; 91 --- 158 unchanged lines hidden --- |