From f90a5bf53ae425bee1f729d80c0d426d2500c6ed Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 21 Jun 2004 03:24:25 +0000 Subject: [PATCH] (match_limit): Cleaner err msg when no match data available. --- src/search.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/search.c b/src/search.c index 24f21f053a5..ec83065bbc3 100644 --- a/src/search.c +++ b/src/search.c @@ -2622,8 +2622,10 @@ match_limit (num, beginningp) CHECK_NUMBER (num); n = XINT (num); - if (n < 0 || search_regs.num_regs <= 0) - args_out_of_range (num, make_number (search_regs.num_regs)); + if (n < 0) + args_out_of_range (num, 0); + if (search_regs.num_regs <= 0) + error ("No match data, because no search succeeded"); if (n >= search_regs.num_regs || search_regs.start[n] < 0) return Qnil; -- 2.39.5