Changeset 1811 in kBuild for trunk/src/kmk/variable.c
- Timestamp:
- Oct 10, 2008 5:19:58 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/variable.c
r1809 r1811 921 921 else 922 922 { 923 #ifndef CONFIG_WITH_VALUE_LENGTH 923 924 v = do_variable_definition ( 924 925 &p->variable.fileinfo, p->variable.name, 925 926 p->variable.value, p->variable.origin, 926 927 p->variable.flavor, 1); 928 #else 929 v = do_variable_definition_2 ( 930 &p->variable.fileinfo, p->variable.name, 931 p->variable.value, p->variable.value_length, 0, 0, 932 p->variable.origin, p->variable.flavor, 1); 933 #endif 927 934 } 928 935 … … 2030 2037 2031 2038 struct variable * 2039 #ifndef CONFIG_WITH_VALUE_LENGTH 2032 2040 parse_variable_definition (struct variable *v, char *line) 2041 #else 2042 parse_variable_definition (struct variable *v, char *line, char *eos) 2043 #endif 2033 2044 { 2034 2045 register int c; … … 2119 2130 v->value = p; 2120 2131 #ifdef CONFIG_WITH_VALUE_LENGTH 2121 v->value_length = v->value_alloc_len = -1; 2132 v->value_alloc_len = -1; 2133 v->value_length = eos != NULL ? eos - p : -1; 2134 assert (eos == NULL || strchr (p, '\0') == eos); 2122 2135 #endif 2123 2136 … … 2153 2166 2154 2167 struct variable * 2168 #ifndef CONFIG_WITH_VALUE_LENGTH 2155 2169 try_variable_definition (const struct floc *flocp, char *line, 2156 2170 enum variable_origin origin, int target_var) 2171 #else 2172 try_variable_definition (const struct floc *flocp, char *line, char *eos, 2173 enum variable_origin origin, int target_var) 2174 #endif 2157 2175 { 2158 2176 struct variable v; … … 2164 2182 v.fileinfo.filenm = 0; 2165 2183 2184 #ifndef CONFIG_WITH_VALUE_LENGTH 2166 2185 if (!parse_variable_definition (&v, line)) 2167 2186 return 0; … … 2169 2188 vp = do_variable_definition (flocp, v.name, v.value, 2170 2189 origin, v.flavor, target_var); 2190 #else 2191 if (!parse_variable_definition (&v, line, eos)) 2192 return 0; 2193 2194 vp = do_variable_definition_2 (flocp, v.name, v.value, 2195 v.value_length != -1 ? v.value_length : ~0U, 2196 0, NULL, origin, v.flavor, target_var); 2197 #endif 2171 2198 2172 2199 free (v.name);
Note:
See TracChangeset
for help on using the changeset viewer.