Not sure whether it's better to use <code>
next_component += strspn(next_component, "/");
</code> or the iteration until *next_component isn't '/'.