Switch order of name mangling for port path detection
This commit is contained in:
parent
53d3fae865
commit
1f8efa6e64
|
@ -328,10 +328,9 @@ public final class SerialPort
|
||||||
else if (!((new File(portDescriptor)).exists()))
|
else if (!((new File(portDescriptor)).exists()))
|
||||||
{
|
{
|
||||||
// Attempt to locate the correct port descriptor
|
// 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);
|
portDescriptor = "/dev/" + portDescriptor.substring(portDescriptor.lastIndexOf('/')+1);
|
||||||
else
|
|
||||||
portDescriptor = "/dev/" + portDescriptor;
|
|
||||||
|
|
||||||
// Check if the updated port descriptor exists
|
// Check if the updated port descriptor exists
|
||||||
if (!((new File(portDescriptor)).exists()))
|
if (!((new File(portDescriptor)).exists()))
|
||||||
|
|
Loading…
Reference in New Issue