[Ltrace-devel] [PATCH 3/6] Add an ability to import config files into other config files

Роман Донченко dpb at corrigendum.ru
Mon Apr 20 18:46:59 UTC 2015


Petr Machata <pmachata at redhat.com> писал в своём письме Mon, 20 Apr 2015  
11:18:30 +0300:

> Great stuff, thanks.
>
>> @@ -1072,6 +1146,11 @@ process_line(struct protolib *plib, struct locus  
>> *loc, char *buf)
>>  	if (*str == ';' || *str == 0 || *str == '\n' || *str == '#')
>>  		return 0;
>>
>> +	if (strncmp(str, "import ", 7) == 0) {
>> +		parse_import(cache, plib, loc, &str);
>> +		return 0;
>> +	}
>> +
>>  	if (strncmp(str, "typedef ", 8) == 0) {
>>  		parse_typedef(plib, loc, &str);
>>  		return 0;
>
> I had to adapt this hunk to use try_parse_kwd, hopefully you don't
> mind.  (And hopefully I didn't break it.)

You did - you forgot to delete (*str) += strlen("import"); in parse_import.



More information about the Ltrace-devel mailing list