Woody Suwalski writes:
accept more then 1 dependency per modules.dep line. Also white space cleanup... I think that parsing still breaks sometimes, but is mostly functional now.
This commit is contained in:
@ -197,7 +197,6 @@ static struct dep_t *build_dep ( void )
|
|||||||
current-> m_next = 0;
|
current-> m_next = 0;
|
||||||
|
|
||||||
//printf ( "%s:\n", mod );
|
//printf ( "%s:\n", mod );
|
||||||
|
|
||||||
p = col + 1;
|
p = col + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -206,15 +205,30 @@ static struct dep_t *build_dep ( void )
|
|||||||
else
|
else
|
||||||
p = buffer;
|
p = buffer;
|
||||||
|
|
||||||
|
while ( p && *p && isblank(*p))
|
||||||
|
p++;
|
||||||
|
|
||||||
if ( p && *p ) {
|
if ( p && *p ) {
|
||||||
char *end = &buffer [l-1];
|
char *end = &buffer [l-1];
|
||||||
char *deps = strrchr ( end, '/' );
|
char *deps;
|
||||||
char *dep;
|
char *dep;
|
||||||
|
char *next;
|
||||||
int ext = 0;
|
int ext = 0;
|
||||||
|
|
||||||
while ( isblank ( *end ) || ( *end == '\\' ))
|
while ( isblank ( *end ) || ( *end == '\\' ))
|
||||||
end--;
|
end--;
|
||||||
|
|
||||||
|
do
|
||||||
|
{
|
||||||
|
next = strchr (p, ' ' );
|
||||||
|
if (next)
|
||||||
|
{
|
||||||
|
*next = 0;
|
||||||
|
next--;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
next = end;
|
||||||
|
|
||||||
deps = strrchr ( p, '/' );
|
deps = strrchr ( p, '/' );
|
||||||
|
|
||||||
if ( !deps || ( deps < p )) {
|
if ( !deps || ( deps < p )) {
|
||||||
@ -227,25 +241,25 @@ static struct dep_t *build_dep ( void )
|
|||||||
deps++;
|
deps++;
|
||||||
|
|
||||||
#if defined(CONFIG_FEATURE_2_6_MODULES)
|
#if defined(CONFIG_FEATURE_2_6_MODULES)
|
||||||
if ((k_version > 4) && ( *(end-2) == '.' ) && *(end-1) == 'k' &&
|
if ((k_version > 4) && ( *(next-2) == '.' ) && *(next-1) == 'k' &&
|
||||||
( *end == 'o' ))
|
( *next == 'o' ))
|
||||||
ext = 3;
|
ext = 3;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
if (( *(end-1) == '.' ) && ( *end == 'o' ))
|
if (( *(next-1) == '.' ) && ( *next == 'o' ))
|
||||||
ext = 2;
|
ext = 2;
|
||||||
|
|
||||||
/* Cope with blank lines */
|
/* Cope with blank lines */
|
||||||
if ((end-deps-ext+1) <= 0)
|
if ((next-deps-ext+1) <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
dep = bb_xstrndup ( deps, next - deps - ext + 1 );
|
||||||
dep = bb_xstrndup ( deps, end - deps - ext + 1 );
|
|
||||||
|
|
||||||
current-> m_depcnt++;
|
current-> m_depcnt++;
|
||||||
current-> m_deparr = (char **) xrealloc ( current-> m_deparr, sizeof ( char *) * current-> m_depcnt );
|
current-> m_deparr = (char **) xrealloc ( current-> m_deparr, sizeof ( char *) * current-> m_depcnt );
|
||||||
current-> m_deparr [current-> m_depcnt - 1] = dep;
|
current-> m_deparr [current-> m_depcnt - 1] = dep;
|
||||||
|
|
||||||
//printf ( " %d) %s\n", current-> m_depcnt, current-> m_deparr [current-> m_depcnt -1] );
|
//printf ( " %d) %s\n", current-> m_depcnt, current-> m_deparr [current-> m_depcnt -1] );
|
||||||
|
} while (next < end);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( buffer [l-1] == '\\' )
|
if ( buffer [l-1] == '\\' )
|
||||||
|
Reference in New Issue
Block a user