Switch order of name mangling for port path detection

This commit is contained in:
hedgecrw85 2021-04-14 09:16:26 -05:00
parent 53d3fae865
commit 1f8efa6e64
1 changed files with 2 additions and 3 deletions

View File

@ -328,10 +328,9 @@ public final class SerialPort
else if (!((new File(portDescriptor)).exists()))
{
// Attempt to locate the correct port descriptor
if (portDescriptor.contains("/"))
portDescriptor = "/dev/" + portDescriptor;
if (!((new File(portDescriptor)).exists()))
portDescriptor = "/dev/" + portDescriptor.substring(portDescriptor.lastIndexOf('/')+1);
else
portDescriptor = "/dev/" + portDescriptor;
// Check if the updated port descriptor exists
if (!((new File(portDescriptor)).exists()))