גריי מאטר ב Laws of Shabbat / Saving Lives on Shabbat · נב
Gray Matter II 52
The Baal Hama’or (Shabbat 7a, in pages of Rif) claims that the three days immediately before Shabbat are considered “prior to Shabbat,” so one who embarks on a voyage within that period intentionally enters a situation that will require violating Shabbat in case of piku’ach nefesh (saving a life). The Shulchan Aruch (Orach Chaim 248:2 and 248:4) appears to codify both explanations.