mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Fix shadow variable
This commit is contained in:
parent
f5f62ee02d
commit
fe2973522e
1 changed files with 4 additions and 4 deletions
|
|
@ -1648,14 +1648,14 @@ GList *tty_search_for_serial_devices(void)
|
||||||
// Example resulting device_name:
|
// Example resulting device_name:
|
||||||
// "ttyUSB0"
|
// "ttyUSB0"
|
||||||
// "3-6.4:1.2"
|
// "3-6.4:1.2"
|
||||||
char *device_name = strrchr(device_path, '/');
|
char *last_part = strrchr(device_path, '/');
|
||||||
device_name++; // Move past the '/'
|
last_part++; // Move past the '/'
|
||||||
|
|
||||||
// Find that part in /sys/devices and return first result string
|
// Find that part in /sys/devices and return first result string
|
||||||
// Example devices_path:
|
// Example devices_path:
|
||||||
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.3/3-6.3:1.0/ttyUSB0"
|
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.3/3-6.3:1.0/ttyUSB0"
|
||||||
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4:1.2"
|
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4:1.2"
|
||||||
char *devices_path = fs_search_directory("/sys/devices", device_name);
|
char *devices_path = fs_search_directory("/sys/devices", last_part);
|
||||||
if (devices_path == NULL)
|
if (devices_path == NULL)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -1665,7 +1665,7 @@ GList *tty_search_for_serial_devices(void)
|
||||||
// Example resulting devices_path:
|
// Example resulting devices_path:
|
||||||
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.3/3-6.3:1.0"
|
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.3/3-6.3:1.0"
|
||||||
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4:1.2"
|
// "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-6/3-6.4/3-6.4:1.2"
|
||||||
char *last_part = strrchr(devices_path, '/');
|
last_part = strrchr(devices_path, '/');
|
||||||
last_part++;
|
last_part++;
|
||||||
if (strcmp(last_part, entry->d_name) == 0)
|
if (strcmp(last_part, entry->d_name) == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue