For readability, could you please change this logic to say:
<code>
// Version label found?
if (firstSlash == -1) { 
    ... 
    } else {
    ...
}
</code>