serial: Remove unneccesary nesting
This commit is contained in:
parent
fbe2f7945d
commit
71dda10656
|
@ -60,13 +60,12 @@ GSList *list_serial_ports(void)
|
||||||
|
|
||||||
ports = NULL;
|
ports = NULL;
|
||||||
for (i = 0; serial_port_glob[i]; i++) {
|
for (i = 0; serial_port_glob[i]; i++) {
|
||||||
if (!glob(serial_port_glob[i], 0, NULL, &g)) {
|
if (glob(serial_port_glob[i], 0, NULL, &g))
|
||||||
|
continue;
|
||||||
for (j = 0; j < g.gl_pathc; j++)
|
for (j = 0; j < g.gl_pathc; j++)
|
||||||
ports = g_slist_append(ports,
|
ports = g_slist_append(ports, strdup(g.gl_pathv[j]));
|
||||||
strdup(g.gl_pathv[j]));
|
|
||||||
globfree(&g);
|
globfree(&g);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return ports;
|
return ports;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue