Rev 1787 | Rev 2015 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1787 | Rev 1880 | ||
---|---|---|---|
Line 76... | Line 76... | ||
76 | { |
76 | { |
77 | sysinfo_item_t *subtree; |
77 | sysinfo_item_t *subtree; |
78 | subtree = *psubtree; |
78 | subtree = *psubtree; |
79 | 79 | ||
80 | if (subtree == NULL) { |
80 | if (subtree == NULL) { |
81 | sysinfo_item_t *item = malloc(sizeof(sysinfo_item_t), 0); |
81 | sysinfo_item_t *item = malloc(sizeof(sysinfo_item_t), 0); |
82 | int i = 0, j; |
82 | int i = 0, j; |
83 | 83 | ||
84 | ASSERT(item); |
84 | ASSERT(item); |
85 | *psubtree = item; |
85 | *psubtree = item; |
86 | item->next = NULL; |
86 | item->next = NULL; |
87 | item->val_type = SYSINFO_VAL_UNDEFINED; |
87 | item->val_type = SYSINFO_VAL_UNDEFINED; |
88 | item->subinfo.table = NULL; |
88 | item->subinfo.table = NULL; |
89 | 89 | ||
90 | while (name[i] && (name[i] != '.')) |
90 | while (name[i] && (name[i] != '.')) |
91 | i++; |
91 | i++; |
92 | 92 | ||
93 | item->name = malloc(i, 0); |
93 | item->name = malloc(i, 0); |
94 | ASSERT(item->name); |
94 | ASSERT(item->name); |
95 | 95 | ||
96 | for (j = 0; j < i; j++) |
96 | for (j = 0; j < i; j++) |
97 | item->name[j] = name[j]; |
97 | item->name[j] = name[j]; |
98 | item->name[j] = 0; |
98 | item->name[j] = 0; |
99 | 99 | ||
100 | if (name[i]) { /* =='.' */ |
100 | if (name[i]) { /* =='.' */ |
101 | item->subinfo_type = SYSINFO_SUBINFO_TABLE; |
101 | item->subinfo_type = SYSINFO_SUBINFO_TABLE; |
102 | return sysinfo_create_path(name + i + 1, &(item->subinfo.table)); |
102 | return sysinfo_create_path(name + i + 1, &(item->subinfo.table)); |
103 | } |
103 | } |
104 | item->subinfo_type = SYSINFO_SUBINFO_NONE; |
104 | item->subinfo_type = SYSINFO_SUBINFO_NONE; |
105 | return item; |
105 | return item; |
106 | } |
106 | } |
107 | 107 | ||
108 | while (subtree != NULL) { |
108 | while (subtree != NULL) { |
109 | int i = 0, j; |
109 | int i = 0, j; |
110 | char *a = (char *) name; |
110 | char *a = (char *) name; |