Changeset 211 for trunk/src/sh_readconf.c
- Timestamp:
- Feb 3, 2009, 8:45:50 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_readconf.c
r205 r211 135 135 { NULL, SH_SECTION_NONE} 136 136 }; 137 138 static char * sh_readconf_expand_value (const char * str) 139 { 140 char * tmp = (char*)str; 141 char * out; 142 143 while (tmp && isspace((int)*tmp)) ++tmp; 144 145 if (tmp[0] == '$' && tmp[1] == '(') 146 { 147 size_t len = strlen(tmp); 148 while (isspace((int) tmp[len-1])) { tmp[len-1] = '\0'; --len; } 149 if (tmp[len-1] == ')') 150 { 151 tmp[len-1] = '\0'; 152 out = sh_ext_popen_str(&tmp[2]); 153 return out; 154 } 155 } 156 return sh_util_strdup(str); 157 } 137 158 138 159 enum { … … 1297 1318 } 1298 1319 1320 /* Expand shell expressions. This return allocated memory which we must free. 1321 */ 1322 value = sh_readconf_expand_value(value); 1323 1324 if (!value || (*value) == '\0') 1325 { 1326 TPT(( 0, FIL__, __LINE__, _("msg=<ConfigFile: empty after shell expansion: %s>\n"), 1327 line)); 1328 SL_RETURN(good_opt, _("sh_readconf_line")); 1329 } 1299 1330 1300 1331 #if defined (SH_WITH_CLIENT) || defined (SH_STANDALONE) … … 1362 1393 } 1363 1394 1395 SH_FREE((char*)value); 1396 1364 1397 SL_RETURN(good_opt, _("sh_readconf_line")); 1365 1398 }
Note:
See TracChangeset
for help on using the changeset viewer.