valerie_response_printf( cmd_arg->response, 1024, "U%d %02d %s %d\n", i, node, constructor, online );
}
}
+ valerie_response_printf( cmd_arg->response, 1024, "\n" );
return error;
}
{
snprintf( fullname, 1023, "%s%s/%s", cmd_arg->root_dir, dir_name, de[i]->d_name );
if ( lstat( fullname, &info ) == 0 &&
- ( S_ISREG( info.st_mode ) || ( strstr( fullname, ".clip" ) && info.st_mode | S_IXUSR ) ) )
+ ( S_ISREG( info.st_mode ) || S_ISLNK( info.st_mode ) || ( strstr( fullname, ".clip" ) && info.st_mode | S_IXUSR ) ) )
valerie_response_printf( cmd_arg->response, 1024, "\"%s\" %llu\n", de[i]->d_name, (unsigned long long) info.st_size );
free( de[ i ] );
}
strncpy( cmd_arg->root_dir, value, 1023 );
/* add a trailing slash if needed */
- if ( cmd_arg->root_dir[ len - 1 ] != '/')
+ if ( len && cmd_arg->root_dir[ len - 1 ] != '/')
{
cmd_arg->root_dir[ len ] = '/';
cmd_arg->root_dir[ len + 1 ] = '\0';