Yes he can eat enough to keep him alive until he gets to the un-forbidden food.
(He has only forbidden you ˹to eat˺ carrion, blood, swine, and what is slaughtered in the name of any other than Allah But if someone is compelled by necessity—neither driven by desire nor exceeding immediate need—they will not be sinful. Surely Allah is All-Forgiving, Most Merciful.)[Al-Baqara 2:173]
نعم يسمح له أن يأكل ما يسد جوعه دون الإسراف في الأكل
(إ نَّمَا حَرَّمَ عَلَيۡڪُمُ ٱلۡمَيۡتَةَ وَٱلدَّمَ وَلَحۡمَ ٱلۡخِنزِيرِ وَمَآ أُهِلَّ بِهِۦ لِغَيۡرِ ٱللَّهِۖ فَمَنِ ٱضۡطُرَّ غَيۡرَ بَاغٍ۬ وَلَا عَادٍ۬ فَلَآ إِثۡمَ عَلَيۡهِۚ إِنَّ ٱللَّهَ غَفُورٌ۬ رَّحِيم )