EK 4988 then EC 1018 at Madrid
Lisbon → Madrid → Basel
Timetable, Madrid time
20:20EK 4988 from Lisbon at the gate
20:00EC 1018 to Basel leaves the gate
23 h 40 apart on the timetable, overnight
EC 1018 leaves 23 h 40 after EK 4988 arrives on the timetable: more than half a day, so not a connection we count.