diff options
| author | Jim Blandy | 1993-01-07 01:47:11 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-01-07 01:47:11 +0000 |
| commit | 8558648404450c91feaf81a47f044b6465cb58d9 (patch) | |
| tree | c1afae83ff0f7acee0889996172def2360d0360d /src | |
| parent | 652304c9d3b94a3969434145eeaa3844bb99afe2 (diff) | |
| download | emacs-8558648404450c91feaf81a47f044b6465cb58d9.tar.gz emacs-8558648404450c91feaf81a47f044b6465cb58d9.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/regex.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/regex.c b/src/regex.c index b0c15c2ca87..eda11b5350a 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | (Implements POSIX draft P10003.2/D11.2, except for | 3 | (Implements POSIX draft P10003.2/D11.2, except for |
| 4 | internationalization features.) | 4 | internationalization features.) |
| 5 | 5 | ||
| 6 | Copyright (C) 1985, 89, 90, 91, 92 Free Software Foundation, Inc. | 6 | Copyright (C) 1993 Free Software Foundation, Inc. |
| 7 | 7 | ||
| 8 | This program is free software; you can redistribute it and/or modify | 8 | This program is free software; you can redistribute it and/or modify |
| 9 | it under the terms of the GNU General Public License as published by | 9 | it under the terms of the GNU General Public License as published by |
| @@ -4869,9 +4869,18 @@ regerror (errcode, preg, errbuf, errbuf_size) | |||
| 4869 | char *errbuf; | 4869 | char *errbuf; |
| 4870 | size_t errbuf_size; | 4870 | size_t errbuf_size; |
| 4871 | { | 4871 | { |
| 4872 | const char *msg | 4872 | const char *msg; |
| 4873 | = re_error_msg[errcode] == NULL ? "Success" : re_error_msg[errcode]; | 4873 | size_t msg_size; |
| 4874 | size_t msg_size = strlen (msg) + 1; /* Includes the null. */ | 4874 | |
| 4875 | if (errcode < 0 | ||
| 4876 | || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0]))) | ||
| 4877 | /* Only error codes returned by the rest of the code should be passed | ||
| 4878 | to this routine. If we are given anything else, or if other regex | ||
| 4879 | code generates an invalid error code, then the program has a bug. | ||
| 4880 | Dump core so we can fix it. */ | ||
| 4881 | abort (); | ||
| 4882 | |||
| 4883 | msg_size = strlen (msg) + 1; /* Includes the null. */ | ||
| 4875 | 4884 | ||
| 4876 | if (errbuf_size != 0) | 4885 | if (errbuf_size != 0) |
| 4877 | { | 4886 | { |