diff options
author | Stefan Eßer <se@FreeBSD.org> | 2023-01-28 20:02:27 +0000 |
---|---|---|
committer | Stefan Eßer <se@FreeBSD.org> | 2023-01-28 20:02:27 +0000 |
commit | e7017237c9d842b4cebdcfb13526cd71a2b2836a (patch) | |
tree | 9b947d28ee94ab6b413bebb96a7d040873038c0d | |
parent | 0b671e8cf134e605567a6b8091958c1f1dfc5140 (diff) |
136 files changed, 631 insertions, 495 deletions
diff --git a/LICENSE.md b/LICENSE.md index 8ab2e6069881..8e6b7e0b9051 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com> +Copyright (c) 2018-2023 Gavin D. Howard <gavin@yzena.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com><br> Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com><br> Copyright (c) 2018 rain-1 <rain1@openmailbox.org><br> -Copyright (c) 2018-2021, Gavin D. Howard <yzena.tech@gmail.com> +Copyright (c) 2018-2023, Gavin D. Howard <gavin@yzena.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -60,7 +60,7 @@ The files `src/rand.c` and `include/rand.h` are under the following copyrights and license: Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors -Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com> +Copyright (c) 2018-2023 Gavin D. Howard <gavin@yzena.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/MEMORY_BUGS.md b/MEMORY_BUGS.md index 894593f84925..1acf80a0297b 100644 --- a/MEMORY_BUGS.md +++ b/MEMORY_BUGS.md @@ -38,7 +38,7 @@ existed in. The first version without this bug is `6.1.0`. -* In version `6.0.0` of `bcl`, there is several use of initialized data that +* In version `6.0.0` of `bcl`, there are several uses of initialized data that have the same root cause: I forgot to call `memset()` on the per-thread global data. This is because the data used to be *actually* global, which meant that it was initialized to zero by the system. This happened because I thought I diff --git a/Makefile.in b/Makefile.in index 9f187cbc61ed..83417a333826 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -1,5 +1,28 @@ # News +## 6.2.0 + +This is a production release with a new feature and a few bug fixes. + +The bug fixes include: + +* A crash when `bc` and `dc` are built using editline, but history is not + activated. +* A missing local in the `uint*()` family of functions in the extended math + library. +* A failure to clear the tail call list in `dc` on error. +* A crash when attempting to swap characters in command-line history when no + characters exist. +* `SIGWINCH` was activated even when history was not. + +The new feature is that stack traces are now given for runtime errors. In debug +mode, the C source file and line of errors are given as well. + +## 6.1.1 + +This is a production release that fixes a build issue with predefined builds and +generated tests. + ## 6.1.0 This is a production release that fixes a discrepancy from the `bc` standard, diff --git a/NOTICE.md b/NOTICE.md index 56d2935ab4b3..c0d3ded5797a 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -1,6 +1,6 @@ # Notice -Copyright 2018-2021 Gavin D. Howard and contributors. +Copyright 2018-2023 Gavin D. Howard and contributors. ## Contributors diff --git a/README.md b/README.md index b1e0d7557de4..438cab0d1694 100644 --- a/README.md +++ b/README.md @@ -318,7 +318,8 @@ may prove useful to any serious users. This `bc` compares favorably to GNU `bc`. * This `bc` builds natively on Windows. -* It has more extensions, which make this `bc` more useful for scripting. +* It has more extensions, which make this `bc` more useful for scripting. (See + [Extensions](#extensions).) * This `bc` is a bit more POSIX compliant. * It has a much less buggy parser. The GNU `bc` will give parse errors for what is actually valid `bc` code, or should be. For example, putting an `else` on @@ -341,6 +342,58 @@ There is one instance where this `bc` is slower: if scripts are light on math. This is because this `bc`'s intepreter is slightly slower than GNU `bc`, but that is because it is more robust. See the [benchmarks][19]. +### Extensions + +Below is a non-comprehensive list of extensions that this `bc` and `dc` have +that all others do not. + +* An extended math library. (See [here][30] for more information.) +* A command-line prompt. +* Turning on and off digit clamping. (Digit clamping is about how to treat + "invalid" digits for a particular base. GNU `bc` uses it, and the BSD `bc` + does not. Mine does both.) +* A pseudo-random number generator. This includes the ability to set the seed + and get reproducible streams of random numbers. +* The ability to use stacks for the globals `scale`, `ibase`, and `obase` + instead of needing to restore them in *every* function. +* The ability to *not* use non-standard keywords. For example, `abs` is a + keyword (a built-in function), but if some script actually defines a function + called that, it's possible to tell my `bc` to not treat it as a keyword, which + will make the script parses correctly. +* The ability to turn on and off printing leading zeroes on numbers greater than + `-1` and less than `1`. +* Outputting in scientific and engineering notation. +* Accepting input in scientific and engineering notation. +* Passing strings and arrays to the `length()` built-in function. (In `dc`, the + `Y` command will do this for arrays, and the `Z` command will do this for both + numbers and strings.) +* The `abs()` built-in function. (This is the `b` command in `dc`.) +* The `is_number()` and `is_string()` built-in functions. (These tell whether a + variable is holding a string or a number, for runtime type checking. The + commands are `u` and `t` in `dc`.) +* For `bc` only, the `divmod()` built-in function for computing a quotient and + remainder at the same time. +* For `bc` only, the `asciify()` built-in function for converting an array to a + string. +* The `$` truncation operator. (It's the same in `bc` and `dc`.) +* The `@` "set scale" operator. (It's the same in `bc` and `dc`.) +* The decimal shift operators. (`<<` and `>>` in `bc`, `H` and `h` in `dc`.) +* Built-in functions or commands to get the max of `scale`, `ibase`, and + `obase`. +* The ability to put strings into variables in `bc`. (This always existed in + `dc`.) +* The `'` command in `dc` for the depth of the execution stack. +* The `y` command in `dc` for the depth of register stacks. +* Built-in functions or commands to get the value of certain environment + variables that might affect execution. +* The `stream` keyword to do the same thing as the `P` command in `dc`. +* Defined order of evaluation. +* Defined exit statuses. +* All environment variables other than `POSIXLY_CORRECT`, `BC_ENV_ARGS`, and + `BC_LINE_LENGTH`. +* The ability for users to define their own defaults for various options during + build. (See [here][31] for more information.) + ## Algorithms To see what algorithms this `bc` uses, see the [algorithms manual][7]. @@ -441,3 +494,5 @@ Folders: [27]: https://en.wikipedia.org/wiki/Bus_factor [28]: ./manuals/development.md [29]: https://github.com/gavinhoward/bc +[30]: ./manuals/bc/A.1.md#extended-library +[31]: ./manuals/build.md#settings diff --git a/TODO.md b/TODO.md deleted file mode 100644 index 9152548085b4..000000000000 --- a/TODO.md +++ /dev/null @@ -1,3 +0,0 @@ -# TODO - -* Implement the more efficient factorial. diff --git a/configure.sh b/configure.sh index fb22ccab299e..3ada5298e9ed 100755 --- a/configure.sh +++ b/configure.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -714,7 +714,7 @@ predefined_build() { hist=1 hist_impl="editline" extra_math=1 - generate_tests=0 + generate_tests=$generate_tests install_manpages=0 nls=1 force=0 @@ -747,7 +747,7 @@ predefined_build() { hist=1 hist_impl="internal" extra_math=1 - generate_tests=1 + generate_tests=$generate_tests install_manpages=1 nls=1 force=0 @@ -1019,13 +1019,6 @@ while getopts "abBcdDeEfgGhHik:lMmNO:p:PrS:s:tTvz-" opt; do fi MAN3DIR="$2" shift ;; - localedir=?*) LOCALEDIR="$LONG_OPTARG" ;; - localedir) - if [ "$#" -lt 2 ]; then - usage "No argument given for '--$arg' option" - fi - LOCALEDIR="$2" - shift ;; karatsuba-len=?*) karatsuba_len="$LONG_OPTARG" ;; karatsuba-len) if [ "$#" -lt 2 ]; then diff --git a/gen/bc_help.txt b/gen/bc_help.txt index db34e6daef95..f78ba9e71dd3 100644 --- a/gen/bc_help.txt +++ b/gen/bc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/gen/dc_help.txt b/gen/dc_help.txt index 633ddf71f226..8b313f8d9e07 100644 --- a/gen/dc_help.txt +++ b/gen/dc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/gen/lib.bc b/gen/lib.bc index 8e6118e80608..b12b23176790 100644 --- a/gen/lib.bc +++ b/gen/lib.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/gen/lib2.bc b/gen/lib2.bc index 23cbec104d02..826f8a430cea 100644 --- a/gen/lib2.bc +++ b/gen/lib2.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -250,8 +250,7 @@ define ubytes(x){ define sbytes(x){ auto p,n,z z=(x<0) - x=abs(x) - x=x$ + x=abs(x)$ n=ubytes(x) p=2^(n*8-1) if(x>p||(!z&&x==p))n*=2 @@ -311,21 +310,19 @@ define void pnlznl(x){ print"\n" } define void output_byte(x,i){ - auto j,p,y,b - j=ibase - ibase=A + auto j,p,y,b,s s=scale scale=0 x=abs(x)$ b=x/(2^(i*8)) - b%=256 - y=log(256,obase) + j=2^8 + b%=j + y=log(j,obase) if(b>1)p=log(b,obase)+1 else p=b for(i=y-p;i>0;--i)print 0 if(b)print b scale=s - ibase=j } define void output_uint(x,n){ auto i diff --git a/gen/strgen.c b/gen/strgen.c index 5bc29333ceca..dbea0212f617 100644 --- a/gen/strgen.c +++ b/gen/strgen.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -68,7 +68,7 @@ static const char* const bc_gen_ex_end = "{{ end }}"; // This is exactly what it looks like. It just slaps a simple license header on // the generated C source file. static const char* const bc_gen_header = - "// Copyright (c) 2018-2021 Gavin D. Howard and contributors.\n" + "// Copyright (c) 2018-2023 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; // clang-format on diff --git a/gen/strgen.sh b/gen/strgen.sh index 005395aa2a6b..5ef66fb2d8c8 100755 --- a/gen/strgen.sh +++ b/gen/strgen.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -82,7 +82,7 @@ if [ -n "$remove_tabs" ]; then fi cat<<EOF -// Copyright (c) 2018-2021 Gavin D. Howard and contributors. +// Copyright (c) 2018-2023 Gavin D. Howard and contributors. // Licensed under the 2-clause BSD license. // *** AUTOMATICALLY GENERATED FROM ${input}. DO NOT MODIFY. *** diff --git a/include/args.h b/include/args.h index 515e53b1e891..3174ba267590 100644 --- a/include/args.h +++ b/include/args.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/bc.h b/include/bc.h index 5e879e83a987..73a85aa406a0 100644 --- a/include/bc.h +++ b/include/bc.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/bcl.h b/include/bcl.h index 0a6f43700797..234fe475f00e 100644 --- a/include/bcl.h +++ b/include/bcl.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/dc.h b/include/dc.h index 42cd842b57ce..9a603c26d1a5 100644 --- a/include/dc.h +++ b/include/dc.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/file.h b/include/file.h index d6b7c4e56f85..95cfa861a734 100644 --- a/include/file.h +++ b/include/file.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/history.h b/include/history.h index 495b315cc311..19c5a0fe27f7 100644 --- a/include/history.h +++ b/include/history.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/lang.h b/include/lang.h index 396fc8a4b34c..4ad6df88f5ed 100644 --- a/include/lang.h +++ b/include/lang.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/lex.h b/include/lex.h index 160c0f114855..54d704f8b447 100644 --- a/include/lex.h +++ b/include/lex.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -43,10 +43,30 @@ #include <vector.h> #include <lang.h> -// Two convencience macros for throwing errors in lex code. They take care of -// plumbing like passing in the current line the lexer is on. +/** + * A convenience macro for throwing errors in lex code. This takes care of + * plumbing like passing in the current line the lexer is on. + * @param l The lexer. + * @param e The error. + */ +#ifndef NDEBUG +#define bc_lex_err(l, e) (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line)) +#else // NDEBUG #define bc_lex_err(l, e) (bc_vm_handleError((e), (l)->line)) +#endif // NDEBUG + +/** + * A convenience macro for throwing errors in lex code. This takes care of + * plumbing like passing in the current line the lexer is on. + * @param l The lexer. + * @param e The error. + */ +#ifndef NDEBUG +#define bc_lex_verr(l, e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (l)->line, __VA_ARGS__)) +#else // NDEBUG #define bc_lex_verr(l, e, ...) (bc_vm_handleError((e), (l)->line, __VA_ARGS__)) +#endif // NDEBUG // BC_LEX_NEG_CHAR returns the char that corresponds to negative for the // current calculator. diff --git a/include/library.h b/include/library.h index 2984de29d208..76df91392da1 100644 --- a/include/library.h +++ b/include/library.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/num.h b/include/num.h index 835dd8e97478..8078809250f8 100644 --- a/include/num.h +++ b/include/num.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/opt.h b/include/opt.h index 3c465c80fbf6..28d9d99a7856 100644 --- a/include/opt.h +++ b/include/opt.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/parse.h b/include/parse.h index ebf234c5f7f9..2527aeb824f8 100644 --- a/include/parse.h +++ b/include/parse.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -105,22 +105,32 @@ #define bc_parse_pushIndex(p, idx) (bc_vec_pushIndex(&(p)->func->code, (idx))) /** - * A convenience macro for throwing errors in parse code. They take care of + * A convenience macro for throwing errors in parse code. This takes care of * plumbing like passing in the current line the lexer is on. * @param p The parser. * @param e The error. */ +#ifndef NDEBUG +#define bc_parse_err(p, e) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line)) +#else // NDEBUG #define bc_parse_err(p, e) (bc_vm_handleError((e), (p)->l.line)) +#endif // NDEBUG /** - * A convenience macro for throwing errors in parse code. They take care of + * A convenience macro for throwing errors in parse code. This takes care of * plumbing like passing in the current line the lexer is on. * @param p The parser. * @param e The error. * @param ... The varags that are needed. */ +#ifndef NDEBUG +#define bc_parse_verr(p, e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (p)->l.line, __VA_ARGS__)) +#else // NDEBUG #define bc_parse_verr(p, e, ...) \ (bc_vm_handleError((e), (p)->l.line, __VA_ARGS__)) +#endif // NDEBUG // Forward declarations. struct BcParse; diff --git a/include/program.h b/include/program.h index 62e867eb7fb8..3acd5157b127 100644 --- a/include/program.h +++ b/include/program.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -320,6 +320,13 @@ bc_program_free(BcProgram* p); #endif // NDEBUG +/** + * Prints a stack trace of the bc functions or dc strings currently executing. + * @param p The program. + */ +void +bc_program_printStackTrace(BcProgram* p); + #if BC_DEBUG_CODE #if BC_ENABLED && DC_ENABLED diff --git a/include/rand.h b/include/rand.h index 7546891dbd64..7db0ee90af1f 100644 --- a/include/rand.h +++ b/include/rand.h @@ -13,7 +13,7 @@ * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/include/read.h b/include/read.h index 0e824d941b50..867dcd7433a3 100644 --- a/include/read.h +++ b/include/read.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/status.h b/include/status.h index ce6251ab0c1d..9962d58d0be0 100644 --- a/include/status.h +++ b/include/status.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -687,11 +687,18 @@ typedef enum BcMode /// Returns true if an exception is in flight, false otherwise. #define BC_SIG_EXC(vm) \ - BC_UNLIKELY(vm->status != (sig_atomic_t) BC_STATUS_SUCCESS || vm->sig) + BC_UNLIKELY((vm)->status != (sig_atomic_t) BC_STATUS_SUCCESS || (vm)->sig) /// Returns true if there is *no* exception in flight, false otherwise. #define BC_NO_SIG_EXC(vm) \ - BC_LIKELY(vm->status == (sig_atomic_t) BC_STATUS_SUCCESS && !vm->sig) + BC_LIKELY((vm)->status == (sig_atomic_t) BC_STATUS_SUCCESS && !(vm)->sig) + +#ifndef _WIN32 +#define BC_SIG_INTERRUPT(vm) \ + BC_UNLIKELY((vm)->sig != 0 && (vm)->sig != SIGWINCH) +#else // _WIN32 +#define BC_SIG_INTERRUPT(vm) BC_UNLIKELY((vm)->sig != 0) +#endif // _WIN32 #ifndef NDEBUG @@ -773,7 +780,7 @@ typedef enum BcMode } \ while (0) -/* +/** * Locks signals, but stores the old lock state, to be restored later by * BC_SIG_TRYUNLOCK. * @param v The variable to store the old lock state to. @@ -786,7 +793,8 @@ typedef enum BcMode } \ while (0) -/* Restores the previous state of a signal lock, and if it is now unlocked, +/** + * Restores the previous state of a signal lock, and if it is now unlocked, * initiates an exception/jump. * @param v The old lock state. */ @@ -949,19 +957,33 @@ typedef enum BcMode * @param l The line of the script that the error happened. * @param ... Extra arguments for error messages as necessary. */ +#ifndef NDEBUG +#define bc_error(e, l, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, (l), __VA_ARGS__)) +#else // NDEBUG #define bc_error(e, l, ...) (bc_vm_handleError((e), (l), __VA_ARGS__)) +#endif // NDEBUG /** * Call bc's error handling routine. * @param e The error. */ +#ifndef NDEBUG +#define bc_err(e) (bc_vm_handleError((e), __FILE__, __LINE__, 0)) +#else // NDEBUG #define bc_err(e) (bc_vm_handleError((e), 0)) +#endif // NDEBUG /** * Call bc's error handling routine. * @param e The error. */ +#ifndef NDEBUG +#define bc_verr(e, ...) \ + (bc_vm_handleError((e), __FILE__, __LINE__, 0, __VA_ARGS__)) +#else // NDEBUG #define bc_verr(e, ...) (bc_vm_handleError((e), 0, __VA_ARGS__)) +#endif // NDEBUG #endif // BC_ENABLE_LIBRARY diff --git a/include/vector.h b/include/vector.h index bf79d30c36dd..51c5e8b95293 100644 --- a/include/vector.h +++ b/include/vector.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/include/version.h b/include/version.h index 2a3e6aa0f34c..d7f8ef5bcc18 100644 --- a/include/version.h +++ b/include/version.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -37,6 +37,6 @@ #define BC_VERSION_H /// The current version. -#define VERSION 6.1.0 +#define VERSION 6.2.0 #endif // BC_VERSION_H diff --git a/include/vm.h b/include/vm.h index 44212eb03598..1c303add2de0 100644 --- a/include/vm.h +++ b/include/vm.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -668,9 +668,6 @@ typedef struct BcVm /// The function to call to parse expressions. BcParseExpr expr; - /// The text to display to label functions in error messages. - const char* func_header; - /// The names of the categories of errors. const char* err_ids[BC_ERR_IDX_NELEMS + BC_ENABLED]; @@ -957,6 +954,7 @@ bc_vm_getenvFree(char* val); */ void bc_vm_jmp(const char* f); + #else // BC_DEBUG_CODE /** @@ -994,15 +992,41 @@ bc_vm_atexit(void); #else // BC_ENABLE_LIBRARY /** + * Calculates the number of decimal digits in the argument. + * @param val The value to calculate the number of decimal digits in. + * @return The number of decimal digits in @a val. + */ +size_t +bc_vm_numDigits(size_t val); + +#ifndef NDEBUG + +/** + * Handle an error. This is the true error handler. It will start a jump series + * if an error occurred. POSIX errors will not cause jumps when warnings are on + * or no POSIX errors are enabled. + * @param e The error. + * @param file The source file where the error occurred. + * @param fline The line in the source file where the error occurred. + * @param line The bc source line where the error occurred. + */ +void +bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...); + +#else // NDEBUG + +/** * Handle an error. This is the true error handler. It will start a jump series * if an error occurred. POSIX errors will not cause jumps when warnings are on * or no POSIX errors are enabled. * @param e The error. - * @param line The source line where the error occurred. + * @param line The bc source line where the error occurred. */ void bc_vm_handleError(BcErr e, size_t line, ...); +#endif // NDEBUG + /** * Handle a fatal error. * @param e The error. @@ -1024,12 +1048,6 @@ bc_vm_atexit(int status); /// A reference to the copyright header. extern const char bc_copyright[]; -/// A reference to the format string for source code line printing. -extern const char* const bc_err_line; - -/// A reference to the format string for source code function printing. -extern const char* const bc_err_func_header; - /// A reference to the array of default error category names. extern const char* bc_errs[]; diff --git a/locales/de_DE.ISO8859-1.msg b/locales/de_DE.ISO8859-1.msg index dc7545e3ed72..858a3946e8f8 100644 --- a/locales/de_DE.ISO8859-1.msg +++ b/locales/de_DE.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Headers for printing errors/warnings. -$set 1 - -1 "Funktion:" - $ Error types. -$set 2 +$set 1 1 "Rechenfehler:" 2 "Analysefehler:" @@ -43,7 +38,7 @@ $set 2 5 "Warnung:" $ Math errors. -$set 3 +$set 2 1 "negative Zahl" 2 "Nicht-Ganzzahl-Wert" @@ -51,7 +46,7 @@ $set 3 4 "Division durch 0" $ Parse errors. -$set 4 +$set 3 1 "Ende der Datei" 2 "ungltiges Zeichen: '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX erlaubt keine Zuweisung von Strings an Variablen oder Arrays" $ Runtime errors. -$set 5 +$set 4 1 "ungltige \"ibase\": muss im Intervall [%lu, %lu] liegen" 2 "ungltige \"obase\": muss im Intervall [%lu, %lu] liegen" @@ -100,7 +95,7 @@ $set 5 11 "kann keinen ungltigen Wert in einem Ausdruck verwenden" $ Fatal errors. -$set 6 +$set 5 1 "Speicherzuweisung fehlgeschlagen" 2 "Ein-Ausgabe-Fehler" diff --git a/locales/de_DE.UTF-8.msg b/locales/de_DE.UTF-8.msg index 7956615e849f..25be4fd79cb9 100644 --- a/locales/de_DE.UTF-8.msg +++ b/locales/de_DE.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Headers for printing errors/warnings. -$set 1 - -1 "Funktion:" - $ Error types. -$set 2 +$set 1 1 "Rechenfehler:" 2 "Analysefehler:" @@ -43,7 +38,7 @@ $set 2 5 "Warnung:" $ Math errors. -$set 3 +$set 2 1 "negative Zahl" 2 "Nicht-Ganzzahl-Wert" @@ -51,7 +46,7 @@ $set 3 4 "Division durch 0" $ Parse errors. -$set 4 +$set 3 1 "Ende der Datei" 2 "ungültiges Zeichen: '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX erlaubt keine Zuweisung von Strings an Variablen oder Arrays" $ Runtime errors. -$set 5 +$set 4 1 "ungültige \"ibase\": muss im Intervall [%lu, %lu] liegen" 2 "ungültige \"obase\": muss im Intervall [%lu, %lu] liegen" @@ -100,7 +95,7 @@ $set 5 11 "kann keinen ungültigen Wert in einem Ausdruck verwenden" $ Fatal errors. -$set 6 +$set 5 1 "Speicherzuweisung fehlgeschlagen" 2 "Ein-Ausgabe-Fehler" diff --git a/locales/en_US.msg b/locales/en_US.msg index c6bfe6dc3f6a..5610496d6e71 100644 --- a/locales/en_US.msg +++ b/locales/en_US.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Function:" - $ Error types. -$set 2 +$set 1 1 "Math error:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Warning:" $ Math errors. -$set 3 +$set 2 1 "negative number" 2 "non-integer number" @@ -51,7 +46,7 @@ $set 3 4 "divide by 0" $ Parse errors. -$set 4 +$set 3 1 "end of file" 2 "invalid character '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX does not allow strings to be assigned to variables or arrays" $ Runtime errors. -$set 5 +$set 4 1 "invalid ibase: must be [%lu, %lu]" 2 "invalid obase: must be [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "cannot use a void value in an expression" $ Fatal errors. -$set 6 +$set 5 1 "memory allocation failed" 2 "I/O error" diff --git a/locales/es_ES.ISO8859-1.msg b/locales/es_ES.ISO8859-1.msg index 30c965111de6..3bf70753559e 100644 --- a/locales/es_ES.ISO8859-1.msg +++ b/locales/es_ES.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Funcin:" - $ Error types. -$set 2 +$set 1 1 "Error de matemtica:" 2 "Error de syntaxis:" @@ -43,7 +38,7 @@ $set 2 5 "Advertencia:" $ Math errors. -$set 3 +$set 2 1 "nmero negativo" 2 "nmero no es entero" @@ -51,7 +46,7 @@ $set 3 4 "divisin por cero" $ Parse errors. -$set 4 +$set 3 1 "fin de archivo" 2 "no vlido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite asignar cadenas a variables o matrices" $ Runtime errors. -$set 5 +$set 4 1 "\"ibase\" no es vlido: debe ser [%lu, %lu]" 2 "\"obase\" no es vlido: debe ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "no puede utilizar un valor vaco en una expresin" $ Fatal errors. -$set 6 +$set 5 1 "error en la asignacin de memoria" 2 "error de I/O" diff --git a/locales/es_ES.UTF-8.msg b/locales/es_ES.UTF-8.msg index 1721dd3d8f2a..0a5cf26d1621 100644 --- a/locales/es_ES.UTF-8.msg +++ b/locales/es_ES.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Función:" - $ Error types. -$set 2 +$set 1 1 "Error de matemática:" 2 "Error de syntaxis:" @@ -43,7 +38,7 @@ $set 2 5 "Advertencia:" $ Math errors. -$set 3 +$set 2 1 "número negativo" 2 "número no es entero" @@ -51,7 +46,7 @@ $set 3 4 "división por cero" $ Parse errors. -$set 4 +$set 3 1 "fin de archivo" 2 "no válido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite asignar cadenas a variables o matrices" $ Runtime errors. -$set 5 +$set 4 1 "\"ibase\" no es válido: debe ser [%lu, %lu]" 2 "\"obase\" no es válido: debe ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "no puede utilizar un valor vacío en una expresión" $ Fatal errors. -$set 6 +$set 5 1 "error en la asignación de memoria" 2 "error de I/O" diff --git a/locales/fr_FR.ISO8859-1.msg b/locales/fr_FR.ISO8859-1.msg index 5d772abcc4ef..f2e07e02b2dc 100644 --- a/locales/fr_FR.ISO8859-1.msg +++ b/locales/fr_FR.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Fonction :" - $ Error types. -$set 2 +$set 1 1 "Erreur de calcul :" 2 "Erreur d'analyse syntaxique :" @@ -43,7 +38,7 @@ $set 2 5 "Avertissement :" $ Math errors. -$set 3 +$set 2 1 "nombre strictement négatif" 2 "nombre non entier" @@ -51,7 +46,7 @@ $set 3 4 "division par 0" $ Parse errors. -$set 4 +$set 3 1 "fin de fichier" 2 "caractère invalide '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX interdit pas d'assigner des chaînes de caractères à des variables ou à des tableaux" $ Runtime errors. -$set 5 +$set 4 1 "ibase invalide : doit être [%lu, %lu]" 2 "obase invalide : doit être [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "une valeur 'void' est inutilisable dans une expression" $ Fatal errors. -$set 6 +$set 5 1 "échec d'allocation mémoire" 2 "erreur d'entrée-sortie" diff --git a/locales/fr_FR.UTF-8.msg b/locales/fr_FR.UTF-8.msg index 6393ab0e5f70..1e9e900746a5 100644 --- a/locales/fr_FR.UTF-8.msg +++ b/locales/fr_FR.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Fonction :" - $ Error types. -$set 2 +$set 1 1 "Erreur de calcul :" 2 "Erreur d'analyse syntaxique :" @@ -43,7 +38,7 @@ $set 2 5 "Avertissement :" $ Math errors. -$set 3 +$set 2 1 "nombre strictement négatif" 2 "nombre non entier" @@ -51,7 +46,7 @@ $set 3 4 "division par 0" $ Parse errors. -$set 4 +$set 3 1 "fin de fichier" 2 "caractère invalide '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX interdit pas d'assigner des chaînes de caractères à des variables ou à des tableaux" $ Runtime errors. -$set 5 +$set 4 1 "ibase invalide : doit être [%lu, %lu]" 2 "obase invalide : doit être [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "une valeur 'void' est inutilisable dans une expression" $ Fatal errors. -$set 6 +$set 5 1 "échec d'allocation mémoire" 2 "erreur d'entrée-sortie" diff --git a/locales/ja_JP.UTF-8.msg b/locales/ja_JP.UTF-8.msg index 3c51aca8194f..d871e9bf6ad2 100644 --- a/locales/ja_JP.UTF-8.msg +++ b/locales/ja_JP.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ その他のメッセージ。 -$set 1 - -1 "関数:" - $ エラーの種類。 -$set 2 +$set 1 1 "数学のエラー:" 2 "パースエラー:" @@ -43,7 +38,7 @@ $set 2 5 "警告:" $ 数学のエラーです。 -$set 3 +$set 2 1 "負の数" 2 "非整数" @@ -51,7 +46,7 @@ $set 3 4 "0で割る" $ 構文解析のエラー。 -$set 4 +$set 3 1 "ファイルの終了" 2 "無効な文字 '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXでは、変数や配列に文字列を割り当てることはできません。" $ ランタイムエラー。 -$set 5 +$set 4 1 "無効なibase:は[%lu、%lu]でなければなりません" 2 "無効なobase:は[%lu、%lu]でなければなりません" @@ -100,7 +95,7 @@ $set 5 11 "式では void 値を使用できません" $ 致命的なエラーが発生しました。 -$set 6 +$set 5 1 "メモリの割り当てに失敗しました" 2 "I/Oエラー" diff --git a/locales/ja_JP.eucJP.msg b/locales/ja_JP.eucJP.msg index 74bd09c27fd5..e8baef5b4989 100644 --- a/locales/ja_JP.eucJP.msg +++ b/locales/ja_JP.eucJP.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ ¾Υå -$set 1 - -1 "ؿ" - $ 顼μࡣ -$set 2 +$set 1 1 "ؤΥ顼" 2 "ѡ顼" @@ -43,7 +38,7 @@ $set 2 5 "ٹ" $ ؤΥ顼Ǥ -$set 3 +$set 2 1 "ο" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0dz" $ ʸϤΥ顼 -$set 4 +$set 3 1 "եνλ" 2 "̵ʸ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXǤϡѿʸƤ뤳ȤϤǤޤ" $ २顼 -$set 5 +$set 4 1 "̵ibase[%lu%lu]ǤʤФʤޤ" 2 "̵obase[%lu%lu]ǤʤФʤޤ" @@ -100,7 +95,7 @@ $set 5 11 "Ǥ void ͤѤǤޤ" $ ̿Ūʥ顼ȯޤ -$set 6 +$set 5 1 "γƤ˼Ԥޤ" 2 "I/O顼" diff --git a/locales/nl_NL.ISO8859-1.msg b/locales/nl_NL.ISO8859-1.msg index 2f60de23cca1..cca79a04091b 100644 --- a/locales/nl_NL.ISO8859-1.msg +++ b/locales/nl_NL.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Diversen berichten. -$set 1 - -1 "Functie:" - $ Fouttypes. -$set 2 +$set 1 1 "Rekenfout:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Waarschuwing:" $ Math error. -$set 3 +$set 2 1 "negatief getal" 2 "niet-integraal getal" @@ -51,7 +46,7 @@ $set 3 4 "delen door 0" $ Parsefouten. -$set 4 +$set 3 1 "einde van het file" 2 "ongeldig teken '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX staat niet toe dat strings worden toegewezen aan variabelen of arrays" $ Runtime fouten. -$set 5 +$set 4 1 "ongeldige ibase: moet [%lu, %lu] zijn" 2 "ongeldige obase: moet [%lu, %lu] zijn" @@ -100,7 +95,7 @@ $set 5 11 "kan geen nietige waarde in een uitdrukking gebruiken" $ Fatale fouten. -$set 6 +$set 5 1 "geheugentoewijzing mislukt" 2 "I/O-fout" diff --git a/locales/nl_NL.UTF-8.msg b/locales/nl_NL.UTF-8.msg index 599628a6cc51..7becb1b880fc 100644 --- a/locales/nl_NL.UTF-8.msg +++ b/locales/nl_NL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Diversen berichten. -$set 1 - -1 "Functie:" - $ Fouttypes. -$set 2 +$set 1 1 "Rekenfout:" 2 "Parse error:" @@ -43,7 +38,7 @@ $set 2 5 "Waarschuwing:" $ Math error. -$set 3 +$set 2 1 "negatief getal" 2 "niet-integraal getal" @@ -51,7 +46,7 @@ $set 3 4 "delen door 0" $ Parsefouten. -$set 4 +$set 3 1 "einde van het file" 2 "ongeldig teken '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX staat niet toe dat strings worden toegewezen aan variabelen of arrays" $ Runtime fouten. -$set 5 +$set 4 1 "ongeldige ibase: moet [%lu, %lu] zijn" 2 "ongeldige obase: moet [%lu, %lu] zijn" @@ -100,7 +95,7 @@ $set 5 11 "kan geen nietige waarde in een uitdrukking gebruiken" $ Fatale fouten. -$set 6 +$set 5 1 "geheugentoewijzing mislukt" 2 "I/O-fout" diff --git a/locales/pl_PL.ISO8859-2.msg b/locales/pl_PL.ISO8859-2.msg index a36d5fe8beb5..e3bd25a59a1b 100644 --- a/locales/pl_PL.ISO8859-2.msg +++ b/locales/pl_PL.ISO8859-2.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Rne wiadomoci. -$set 1 - -1 "Funkcja:" - $ Typy bdw. -$set 2 +$set 1 1 "Bd matematyczny:" 2 "Bd parse'a:" @@ -43,7 +38,7 @@ $set 2 5 "Ostrzeenie:" $ Bdy matematyczne. -$set 3 +$set 2 1 "liczba ujemna" 2 "numer nieintegracyjny" @@ -51,7 +46,7 @@ $set 3 4 "dzielenie przez 0" $ Bdy Parse'a. -$set 4 +$set 3 1 "koniec akt" 2 "niewany znak '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX nie pozwala na przypisywanie cigw znakw do zmiennych lub tablic" $ Bdy Runtime'u. -$set 5 +$set 4 1 "nieprawidowa ibase: musi by [%lu, %lu]" 2 "nieprawidowa obase: musi by [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "nie moe uy wartoci pustej w wyraeniu" $ Fatalne bdy. -$set 6 +$set 5 1 "Alokacja pamici nie powioda si" 2 "Bd we/wy" diff --git a/locales/pl_PL.UTF-8.msg b/locales/pl_PL.UTF-8.msg index ee297161a895..c6766e2f4e98 100644 --- a/locales/pl_PL.UTF-8.msg +++ b/locales/pl_PL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Różne wiadomości. -$set 1 - -1 "Funkcja:" - $ Typy błędów. -$set 2 +$set 1 1 "Błąd matematyczny:" 2 "Błąd parse'a:" @@ -43,7 +38,7 @@ $set 2 5 "Ostrzeżenie:" $ Błędy matematyczne. -$set 3 +$set 2 1 "liczba ujemna" 2 "numer nieintegracyjny" @@ -51,7 +46,7 @@ $set 3 4 "dzielenie przez 0" $ Błędy Parse'a. -$set 4 +$set 3 1 "koniec akt" 2 "nieważny znak '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX nie pozwala na przypisywanie ciągów znaków do zmiennych lub tablic" $ Błędy Runtime'u. -$set 5 +$set 4 1 "nieprawidłowa ibase: musi być [%lu, %lu]" 2 "nieprawidłowa obase: musi być [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "nie może użyć wartości pustej w wyrażeniu" $ Fatalne błędy. -$set 6 +$set 5 1 "Alokacja pamięci nie powiodła się" 2 "Błąd we/wy" diff --git a/locales/pt_PT.ISO8859-1.msg b/locales/pt_PT.ISO8859-1.msg index 6197a73d0fe2..0a02064248c4 100644 --- a/locales/pt_PT.ISO8859-1.msg +++ b/locales/pt_PT.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Funo:" - $ Error types. -$set 2 +$set 1 1 "Erro de clculo:" 2 "Erro de anlise de sintaxe:" @@ -43,7 +38,7 @@ $set 2 5 "Aviso:" $ Math errors. -$set 3 +$set 2 1 "nmero negativo" 2 "nmero no inteiro" @@ -51,7 +46,7 @@ $set 3 4 "dividir por 0" $ Parse errors. -$set 4 +$set 3 1 "fim do arquivo" 2 "caractere invlido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX no permite a atribuio de cadeias de caracteres a variveis ou matrizes" $ Runtime errors. -$set 5 +$set 4 1 "ibase invlido: deve ser [%lu, %lu]" 2 "obase invlido: deve ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "um valor 'void' no pode ser usado em uma expresso" $ Fatal errors. -$set 6 +$set 5 1 "falha na alocao de memria" 2 "erro de entrada-sada" diff --git a/locales/pt_PT.UTF-8.msg b/locales/pt_PT.UTF-8.msg index 768f8807ebfc..36c3b6921291 100644 --- a/locales/pt_PT.UTF-8.msg +++ b/locales/pt_PT.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Miscellaneous messages. -$set 1 - -1 "Função:" - $ Error types. -$set 2 +$set 1 1 "Erro de cálculo:" 2 "Erro de análise de sintaxe:" @@ -43,7 +38,7 @@ $set 2 5 "Aviso:" $ Math errors. -$set 3 +$set 2 1 "número negativo" 2 "número não inteiro" @@ -51,7 +46,7 @@ $set 3 4 "dividir por 0" $ Parse errors. -$set 4 +$set 3 1 "fim do arquivo" 2 "caractere inválido '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX não permite a atribuição de cadeias de caracteres a variáveis ou matrizes" $ Runtime errors. -$set 5 +$set 4 1 "ibase inválido: deve ser [%lu, %lu]" 2 "obase inválido: deve ser [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "um valor 'void' não pode ser usado em uma expressão" $ Fatal errors. -$set 6 +$set 5 1 "falha na alocação de memória" 2 "erro de entrada-saída" diff --git a/locales/ru_RU.CP1251.msg b/locales/ru_RU.CP1251.msg index a094e08e4afb..644470eb657b 100644 --- a/locales/ru_RU.CP1251.msg +++ b/locales/ru_RU.CP1251.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.CP866.msg b/locales/ru_RU.CP866.msg index 79070cda2e0c..ee49a2a45427 100644 --- a/locales/ru_RU.CP866.msg +++ b/locales/ru_RU.CP866.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ ᮮ饭. -$set 1 - -1 "㭪:" - $ 訡. -$set 2 +$set 1 1 "⥬᪠ 訡:" 2 "訡 ࠧ:" @@ -43,7 +38,7 @@ $set 2 5 "।०:" $ ⥬᪨ 訡. -$set 3 +$set 2 1 "⥫쭮 " 2 "⥣ " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ 訡 ࠧ. -$set 4 +$set 3 1 " 䠩" 2 "⨬ ᨬ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX ᢠ ப ६ ᨢ" $ 訡 믮. -$set 5 +$set 4 1 "⢨⥫ ibase: [%lu, %lu]" 2 "⢨⥫ obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " ᯮ짮 ⮥ 祭 ࠦ" $ ⠫ 訡. -$set 6 +$set 5 1 " 㤠 뤥 " 2 "訡 /뢮" diff --git a/locales/ru_RU.ISO8859-5.msg b/locales/ru_RU.ISO8859-5.msg index 4c544e94f846..a2921a0465e9 100644 --- a/locales/ru_RU.ISO8859-5.msg +++ b/locales/ru_RU.ISO8859-5.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.KOI8-R.msg b/locales/ru_RU.KOI8-R.msg index 50c716b5ca2e..a5ee84751f16 100644 --- a/locales/ru_RU.KOI8-R.msg +++ b/locales/ru_RU.KOI8-R.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ . -$set 1 - -1 ":" - $ . -$set 2 +$set 1 1 " :" 2 " :" @@ -43,7 +38,7 @@ $set 2 5 ":" $ . -$set 3 +$set 2 1 " " 2 " " @@ -51,7 +46,7 @@ $set 3 4 " 0" $ . -$set 4 +$set 3 1 " " 2 " '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX " $ . -$set 5 +$set 4 1 " ibase: [%lu, %lu]" 2 " obase: [%lu, %lu]" @@ -99,7 +94,7 @@ $set 5 10 " " $ . -$set 6 +$set 5 1 " " 2 " /" diff --git a/locales/ru_RU.UTF-8.msg b/locales/ru_RU.UTF-8.msg index e37bb2182caf..cd95ad24e663 100644 --- a/locales/ru_RU.UTF-8.msg +++ b/locales/ru_RU.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Разные сообщения. -$set 1 - -1 "Функция:" - $ Типы ошибок. -$set 2 +$set 1 1 "Математическая ошибка:" 2 "Ошибка при разборе:" @@ -43,7 +38,7 @@ $set 2 5 "Предупреждение:" $ Математические ошибки. -$set 3 +$set 2 1 "отрицательное число" 2 "неинтегрированное число" @@ -51,7 +46,7 @@ $set 3 4 "делить на 0" $ Ошибки при разборе. -$set 4 +$set 3 1 "конец файла" 2 "недопустимый символ '%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX не позволяет присваивать строки переменным или массивам" $ Ошибки выполнения. -$set 5 +$set 4 1 "Недействительный ibase: должен быть [%lu, %lu]" 2 "Недействительный obase: должен быть [%lu, %lu]" @@ -100,7 +95,7 @@ $set 5 11 "не может использовать пустое значение в выражении" $ Фатальные ошибки. -$set 6 +$set 5 1 "Не удалось выделить память" 2 "Ошибка ввода/вывода" diff --git a/locales/zh_CN.GB18030.msg b/locales/zh_CN.GB18030.msg index a2210b19ed29..0ec91394c921 100644 --- a/locales/zh_CN.GB18030.msg +++ b/locales/zh_CN.GB18030.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.GB2312.msg b/locales/zh_CN.GB2312.msg index a2210b19ed29..0ec91394c921 100644 --- a/locales/zh_CN.GB2312.msg +++ b/locales/zh_CN.GB2312.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.GBK.msg b/locales/zh_CN.GBK.msg index a2210b19ed29..0ec91394c921 100644 --- a/locales/zh_CN.GBK.msg +++ b/locales/zh_CN.GBK.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/locales/zh_CN.UTF-8.msg b/locales/zh_CN.UTF-8.msg index 92d1bb767cb0..1fbb16d1cfd1 100644 --- a/locales/zh_CN.UTF-8.msg +++ b/locales/zh_CN.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ 杂项信息。 -$set 1 - -1 "函数:" - $ 错误类型。 -$set 2 +$set 1 1 "数学错误:" 2 "解析错误:" @@ -43,7 +38,7 @@ $set 2 5 "警告:" $ 数学错误。 -$set 3 +$set 2 1 "负数" 2 "非整数" @@ -51,7 +46,7 @@ $set 3 4 "除以0" $ 解析错误。 -$set 4 +$set 3 1 "文件结束" 2 "无效字符'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIX不允许将字符串分配给变量或数组" $ 运行时错误。 -$set 5 +$set 4 1 "无效的ibase: 必须是[%lu, %lu]" 2 "无效的obase:必须是[%lu,%lu]" @@ -100,7 +95,7 @@ $set 5 11 “不能在表达式中使用空值” $ 致命错误。 -$set 6 +$set 5 1 "内存分配失败" 2 "I/O错误" diff --git a/locales/zh_CN.eucCN.msg b/locales/zh_CN.eucCN.msg index a2210b19ed29..0ec91394c921 100644 --- a/locales/zh_CN.eucCN.msg +++ b/locales/zh_CN.eucCN.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2023 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: @@ -28,13 +28,8 @@ $ $ $quote " -$ Ϣ -$set 1 - -1 "" - $ ͡ -$set 2 +$set 1 1 "ѧ" 2 "" @@ -43,7 +38,7 @@ $set 2 5 "棺" $ ѧ -$set 3 +$set 2 1 "" 2 "" @@ -51,7 +46,7 @@ $set 3 4 "0" $ -$set 4 +$set 3 1 "ļ" 2 "Чַ'%c'" @@ -85,7 +80,7 @@ $set 4 30 "POSIXַ" $ ʱ -$set 5 +$set 4 1 "Чibase: [%lu, %lu]" 2 "Чobase[%lu%lu]" @@ -100,7 +95,7 @@ $set 5 11 ڱʽʹÿֵ $ -$set 6 +$set 5 1 "ڴʧ" 2 "I/O" diff --git a/manuals/bc/A.1 b/manuals/bc/A.1 index e8b8bd0892a8..629cc32c4c69 100644 --- a/manuals/bc/A.1 +++ b/manuals/bc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/A.1.md b/manuals/bc/A.1.md index 754ceda1adb6..40cfa5fcdad6 100644 --- a/manuals/bc/A.1.md +++ b/manuals/bc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/E.1 b/manuals/bc/E.1 index f9e8c8b2d02f..89f95ef81cfa 100644 --- a/manuals/bc/E.1 +++ b/manuals/bc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/E.1.md b/manuals/bc/E.1.md index cf52f5a2035e..30451dabd64b 100644 --- a/manuals/bc/E.1.md +++ b/manuals/bc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EH.1 b/manuals/bc/EH.1 index 5c556c049f14..e006a5c41c84 100644 --- a/manuals/bc/EH.1 +++ b/manuals/bc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EH.1.md b/manuals/bc/EH.1.md index bb905be37f95..28f874c36ebe 100644 --- a/manuals/bc/EH.1.md +++ b/manuals/bc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EHN.1 b/manuals/bc/EHN.1 index d5fafaf4d1da..e77148710255 100644 --- a/manuals/bc/EHN.1 +++ b/manuals/bc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EHN.1.md b/manuals/bc/EHN.1.md index 0ea13df66b7f..09288c577a5c 100644 --- a/manuals/bc/EHN.1.md +++ b/manuals/bc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EN.1 b/manuals/bc/EN.1 index 895b21051408..99ecfd2056e2 100644 --- a/manuals/bc/EN.1 +++ b/manuals/bc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/EN.1.md b/manuals/bc/EN.1.md index 6fb521188cc0..52bacfa5df63 100644 --- a/manuals/bc/EN.1.md +++ b/manuals/bc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/H.1 b/manuals/bc/H.1 index 72d561fdea00..856d2c604dee 100644 --- a/manuals/bc/H.1 +++ b/manuals/bc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/H.1.md b/manuals/bc/H.1.md index 669aa1b1bf37..4a1278dbec86 100644 --- a/manuals/bc/H.1.md +++ b/manuals/bc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/HN.1 b/manuals/bc/HN.1 index b90c88fb59b6..5356950aa68c 100644 --- a/manuals/bc/HN.1 +++ b/manuals/bc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/HN.1.md b/manuals/bc/HN.1.md index cf4a9d4024f1..8dd0674512ac 100644 --- a/manuals/bc/HN.1.md +++ b/manuals/bc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/N.1 b/manuals/bc/N.1 index 378094edeaf0..517e403aa6ca 100644 --- a/manuals/bc/N.1 +++ b/manuals/bc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bc/N.1.md b/manuals/bc/N.1.md index 5ed9ed677671..2c85180f670f 100644 --- a/manuals/bc/N.1.md +++ b/manuals/bc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/bcl.3 b/manuals/bcl.3 index b81d001ce3e5..e066103d02f4 100644 --- a/manuals/bcl.3 +++ b/manuals/bcl.3 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/bcl.3.md b/manuals/bcl.3.md index 22c863b955d2..e2d92866ddbe 100644 --- a/manuals/bcl.3.md +++ b/manuals/bcl.3.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/build.md b/manuals/build.md index 14c1fb557984..5cec45f596b4 100644 --- a/manuals/build.md +++ b/manuals/build.md @@ -132,7 +132,7 @@ the environment variable `GEN_EMU`. This `bc` supports `CC`, `HOSTCC`, `HOST_CC`, `CFLAGS`, `HOSTCFLAGS`, `HOST_CFLAGS`, `CPPFLAGS`, `LDFLAGS`, `LDLIBS`, `PREFIX`, `DESTDIR`, `BINDIR`, -`DATAROOTDIR`, `DATADIR`, `MANDIR`, `MAN1DIR`, `LOCALEDIR` `EXECSUFFIX`, +`DATAROOTDIR`, `DATADIR`, `MANDIR`, `MAN1DIR`, `MAN3DIR`, `EXECSUFFIX`, `EXECPREFIX`, `LONG_BIT`, `GEN_HOST`, and `GEN_EMU` environment variables in `configure.sh`. Any values of those variables given to `configure.sh` will be put into the generated Makefile. @@ -276,13 +276,13 @@ Can be overridden by passing the `--man1dir` option to `configure.sh`. Defaults to `$MANDIR/man1`. -#### `LOCALEDIR` +#### `MAN3DIR` -The directory to install locales in. +The directory to install Section 3 manpages in. -Can be overridden by passing the `--localedir` option to `configure.sh`. +Can be overridden by passing the `--man3dir` option to `configure.sh`. -Defaults to `$DATAROOTDIR/locale`. +Defaults to `$MANDIR/man3`. #### `EXECSUFFIX` @@ -709,19 +709,18 @@ The relevant `autotools`-style install options are supported in `configure.sh`: * `--datadir` * `--mandir` * `--man1dir` -* `--localedir` +* `--man3dir` An example is: ``` -./configure.sh --prefix=/usr --localedir /usr/share/nls +./configure.sh --prefix=/usr make make install ``` They correspond to the environment variables `$PREFIX`, `$BINDIR`, -`$DATAROOTDIR`, `$DATADIR`, `$MANDIR`, `$MAN1DIR`, and `$LOCALEDIR`, -respectively. +`$DATAROOTDIR`, `$DATADIR`, `$MANDIR`, `$MAN1DIR`, `$MAN3DIR`, and respectively. ***WARNING***: Locales ignore the prefix because they *must* be installed at a fixed location to work at all. If you do not want that to happen, you must diff --git a/manuals/dc/A.1 b/manuals/dc/A.1 index a625564b7692..6500bf9129e2 100644 --- a/manuals/dc/A.1 +++ b/manuals/dc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/A.1.md b/manuals/dc/A.1.md index d2de6a187ab7..4c40e38dcee8 100644 --- a/manuals/dc/A.1.md +++ b/manuals/dc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/E.1 b/manuals/dc/E.1 index e89e1a8544c8..7f2477f10772 100644 --- a/manuals/dc/E.1 +++ b/manuals/dc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/E.1.md b/manuals/dc/E.1.md index eadf99cb7928..437fc645937a 100644 --- a/manuals/dc/E.1.md +++ b/manuals/dc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EH.1 b/manuals/dc/EH.1 index 59cfb2894c37..ba4e67507028 100644 --- a/manuals/dc/EH.1 +++ b/manuals/dc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EH.1.md b/manuals/dc/EH.1.md index 06c2af44ac1e..6d1dd78985b2 100644 --- a/manuals/dc/EH.1.md +++ b/manuals/dc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EHN.1 b/manuals/dc/EHN.1 index a2bc6cab0eaa..5f454d01cc2e 100644 --- a/manuals/dc/EHN.1 +++ b/manuals/dc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EHN.1.md b/manuals/dc/EHN.1.md index 96ee28904ee2..e3786886a035 100644 --- a/manuals/dc/EHN.1.md +++ b/manuals/dc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EN.1 b/manuals/dc/EN.1 index 980f0d50c13c..6f08fc8d3c0c 100644 --- a/manuals/dc/EN.1 +++ b/manuals/dc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/EN.1.md b/manuals/dc/EN.1.md index 713cc2fcc82d..b97e121e2226 100644 --- a/manuals/dc/EN.1.md +++ b/manuals/dc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/H.1 b/manuals/dc/H.1 index e9934a85d4a4..cc2f156205e6 100644 --- a/manuals/dc/H.1 +++ b/manuals/dc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/H.1.md b/manuals/dc/H.1.md index 55cc7cbe3005..b8ad29b28a85 100644 --- a/manuals/dc/H.1.md +++ b/manuals/dc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/HN.1 b/manuals/dc/HN.1 index d22b159db067..8d16b10a23de 100644 --- a/manuals/dc/HN.1 +++ b/manuals/dc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/HN.1.md b/manuals/dc/HN.1.md index c9c980996234..d658409b8362 100644 --- a/manuals/dc/HN.1.md +++ b/manuals/dc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/N.1 b/manuals/dc/N.1 index 9988fe063750..54fbadeed09c 100644 --- a/manuals/dc/N.1 +++ b/manuals/dc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2023 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/manuals/dc/N.1.md b/manuals/dc/N.1.md index 52ffa0b23cfa..35573c49da90 100644 --- a/manuals/dc/N.1.md +++ b/manuals/dc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2021 Gavin D. Howard and contributors. +Copyright (c) 2018-2023 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/scripts/exec-install.sh b/scripts/exec-install.sh index f36caa37e6f8..3b9375af3834 100755 --- a/scripts/exec-install.sh +++ b/scripts/exec-install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/format.sh b/scripts/format.sh index 74ca9dc35432..efb90ef1f328 100755 --- a/scripts/format.sh +++ b/scripts/format.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/functions.sh b/scripts/functions.sh index f2c5b0b50eae..98cb5cf7aae0 100755 --- a/scripts/functions.sh +++ b/scripts/functions.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/karatsuba.py b/scripts/karatsuba.py index 9aa1c2a5457f..9c94ffe448f7 100755 --- a/scripts/karatsuba.py +++ b/scripts/karatsuba.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/link.sh b/scripts/link.sh index f1c403d50dda..4a472828f3e9 100755 --- a/scripts/link.sh +++ b/scripts/link.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/lint.sh b/scripts/lint.sh index 65f81c5f6511..78260dff2daa 100755 --- a/scripts/lint.sh +++ b/scripts/lint.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/locale_install.sh b/scripts/locale_install.sh index a67e6aa52970..a2d9ccda7ade 100755 --- a/scripts/locale_install.sh +++ b/scripts/locale_install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/scripts/locale_uninstall.sh b/scripts/locale_uninstall.sh index 3e79e083b803..dfa3899db26b 100755 --- a/scripts/locale_uninstall.sh +++ b/scripts/locale_uninstall.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/src/args.c b/src/args.c index 8e3b2ea14495..60a82ac1b867 100644 --- a/src/args.c +++ b/src/args.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/bc_lex.c b/src/bc_lex.c index a4641be0b653..5c9d2c536ea3 100644 --- a/src/bc_lex.c +++ b/src/bc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/bc_parse.c b/src/bc_parse.c index 1617384cd59f..c64c194863f1 100644 --- a/src/bc_parse.c +++ b/src/bc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1973,7 +1973,7 @@ bc_parse_parse(BcParse* p) exit: // We need to reset on error. - if (BC_ERR(((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig))) + if (BC_ERR(((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig != 0))) { bc_parse_reset(p); } diff --git a/src/data.c b/src/data.c index 5e578778d0ff..1694bb684718 100644 --- a/src/data.c +++ b/src/data.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -70,7 +70,7 @@ const uchar dc_sig_msg_len = (uchar) (sizeof(dc_sig_msg) - 1); /// The copyright banner. const char bc_copyright[] = - "Copyright (c) 2018-2022 Gavin D. Howard and contributors\n" + "Copyright (c) 2018-2023 Gavin D. Howard and contributors\n" "Report bugs at: https://git.yzena.com/gavin/bc\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n"; @@ -174,12 +174,6 @@ const BcOptLong bc_args_lopt[] = { }; -/// The function header for error messages. -const char* const bc_err_func_header = "Function:"; - -/// The line format string for error messages. -const char* const bc_err_line = ":%zu"; - // clang-format off /// The default error category strings. @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/dc_lex.c b/src/dc_lex.c index 4ca019818941..cf737ea3c80c 100644 --- a/src/dc_lex.c +++ b/src/dc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/dc_parse.c b/src/dc_parse.c index ef95e22f357a..638ccfb769c5 100644 --- a/src/dc_parse.c +++ b/src/dc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/file.c b/src/file.c index 24ca89765646..aeee9f97aa98 100644 --- a/src/file.c +++ b/src/file.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -336,7 +336,7 @@ bc_file_vprintf(BcFile* restrict f, const char* fmt, va_list args) bc_file_puts(f, bc_flush_none, s); } -#if BC_DEBUG_CODE +#ifndef NDEBUG // We only print signed integers in debug code. else if (c == 'd') { @@ -357,7 +357,7 @@ bc_file_vprintf(BcFile* restrict f, const char* fmt, va_list args) bc_file_puts(f, bc_flush_none, buf); } } -#endif // BC_DEBUG_CODE +#endif // NDEBUG else { unsigned long long ull; diff --git a/src/history.c b/src/history.c index bc15da5b8f1d..b289cf73a24a 100644 --- a/src/history.c +++ b/src/history.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -159,12 +159,14 @@ volatile sig_atomic_t bc_history_inlinelib; static char* bc_history_prompt; static char bc_history_no_prompt[] = ""; static HistEvent bc_history_event; +static bool bc_history_use_prompt; static char* bc_history_promptFunc(EditLine* el) { BC_UNUSED(el); - return BC_PROMPT ? bc_history_prompt : bc_history_no_prompt; + return BC_PROMPT && bc_history_use_prompt ? bc_history_prompt : + bc_history_no_prompt; } void @@ -255,8 +257,18 @@ bc_history_line(BcHistory* h, BcVec* vec, const char* prompt) else bc_history_prompt = bc_vm_strdup(prompt); } + bc_history_use_prompt = true; + + line = NULL; + len = -1; + errno = EINTR; + // Get the line. - line = el_gets(h->el, &len); + while (line == NULL && len == -1 && errno == EINTR) + { + line = el_gets(h->el, &len); + bc_history_use_prompt = false; + } // If there is no line... if (BC_ERR(line == NULL)) @@ -1455,6 +1467,9 @@ bc_history_swap(BcHistory* h) BC_SIG_ASSERT_LOCKED; + // If there are no characters, skip. + if (!h->pos) return; + // Get the length of the previous and next characters. pcl = bc_history_prevLen(h->buf.v, h->pos); ncl = bc_history_nextLen(h->buf.v, BC_HIST_BUF_LEN(h), h->pos, NULL); diff --git a/src/lang.c b/src/lang.c index 20295c26e3da..cb928ba31f7e 100644 --- a/src/lang.c +++ b/src/lang.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/lex.c b/src/lex.c index 142ffaa22ae1..7dc1fb03bd3a 100644 --- a/src/lex.c +++ b/src/lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/library.c b/src/library.c index 6286afcc73cb..223fe4a208fc 100644 --- a/src/library.c +++ b/src/library.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/main.c b/src/main.c index 92d85797bd46..7809925dcf71 100644 --- a/src/main.c +++ b/src/main.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/num.c b/src/num.c index be9ee2e6d6eb..58beb1dbad8b 100644 --- a/src/num.c +++ b/src/num.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/opt.c b/src/opt.c index 14ef989f1545..dada7442ec0b 100644 --- a/src/opt.c +++ b/src/opt.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/parse.c b/src/parse.c index 984e5a14daae..1834bde2883d 100644 --- a/src/parse.c +++ b/src/parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/src/program.c b/src/program.c index e63949bb49e5..5424b715a29b 100644 --- a/src/program.c +++ b/src/program.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -2934,6 +2934,41 @@ bc_program_init(BcProgram* p) } void +bc_program_printStackTrace(BcProgram* p) +{ + size_t i, max_digits; + + max_digits = bc_vm_numDigits(p->stack.len - 1); + + for (i = 0; i < p->stack.len; ++i) + { + BcInstPtr* ip = bc_vec_item_rev(&p->stack, i); + BcFunc* f = bc_vec_item(&p->fns, ip->func); + size_t j, digits; + + digits = bc_vm_numDigits(i); + + bc_file_puts(&vm->ferr, bc_flush_none, " "); + + for (j = 0; j < max_digits - digits; ++j) + { + bc_file_putchar(&vm->ferr, bc_flush_none, ' '); + } + + bc_file_printf(&vm->ferr, "%zu: %s", i, f->name); + +#if BC_ENABLED + if (BC_IS_BC && ip->func != BC_PROG_MAIN && ip->func != BC_PROG_READ) + { + bc_file_puts(&vm->ferr, bc_flush_none, "()"); + } +#endif // BC_ENABLED + + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + } +} + +void bc_program_reset(BcProgram* p) { BcFunc* f; @@ -2945,6 +2980,11 @@ bc_program_reset(BcProgram* p) bc_vec_npop(&p->stack, p->stack.len - 1); bc_vec_popAll(&p->results); +#if DC_ENABLED + // We need to pop tail calls too. + if (BC_IS_DC) bc_vec_npop(&p->tail_calls, p->tail_calls.len - 1); +#endif // DC_ENABLED + #if BC_ENABLED // Clear the globals' stacks. if (BC_G) bc_program_popGlobals(p, true); @@ -2959,13 +2999,15 @@ bc_program_reset(BcProgram* p) // NOLINTNEXTLINE memset(ip, 0, sizeof(BcInstPtr)); - // Write the ready message for a signal, and clear the signal. - if (vm->sig) + if (BC_SIG_INTERRUPT(vm)) { + // Write the ready message for a signal. bc_file_printf(&vm->fout, "%s", bc_program_ready_msg); bc_file_flush(&vm->fout, bc_flush_err); - vm->sig = 0; } + + // Clear the signal. + vm->sig = 0; } void @@ -3015,6 +3057,8 @@ bc_program_exec(BcProgram* p) bc_vec_pushByte(&func->code, BC_INST_INVALID); #endif // BC_HAS_COMPUTED_GOTO + BC_SETJMP(vm, end); + ip = bc_vec_top(&p->stack); func = (BcFunc*) bc_vec_item(&p->fns, ip->func); code = func->code.v; @@ -3642,7 +3686,7 @@ bc_program_exec(BcProgram* p) BC_PROG_LBL(BC_INST_INVALID): // clang-format on { - return; + goto end; } #else // BC_HAS_COMPUTED_GOTO default: @@ -3676,6 +3720,28 @@ bc_program_exec(BcProgram* p) #endif // BC_HAS_COMPUTED_GOTO } + +end: + BC_SIG_MAYLOCK; + + // This is here just to print a stack trace on interrupts. This is for + // finding infinite loops. + if (BC_SIG_INTERRUPT(vm)) + { + BcStatus s; + + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + + bc_program_printStackTrace(p); + + s = bc_file_flushErr(&vm->ferr, bc_flush_err); + if (BC_ERR(s != BC_STATUS_SUCCESS && vm->status == BC_STATUS_SUCCESS)) + { + vm->status = (sig_atomic_t) s; + } + } + + BC_LONGJMP_CONT(vm); } #if BC_DEBUG_CODE diff --git a/src/rand.c b/src/rand.c index c762f1f36024..11c22cd507c3 100644 --- a/src/rand.c +++ b/src/rand.c @@ -13,7 +13,7 @@ * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/src/read.c b/src/read.c index d6b0deb7814a..d5af9e1ba273 100644 --- a/src/read.c +++ b/src/read.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -171,20 +171,34 @@ bc_read_chars(BcVec* vec, const char* prompt) // If interupted... if (errno == EINTR) { + int sig; + // Jump out if we are supposed to quit, which certain signals // will require. if (vm->status == (sig_atomic_t) BC_STATUS_QUIT) BC_JMP; - assert(vm->sig); + assert(vm->sig != 0); + + sig = (int) vm->sig; // Clear the signal and status. vm->sig = 0; vm->status = (sig_atomic_t) BC_STATUS_SUCCESS; - // Print the ready message and prompt again. - bc_file_puts(&vm->fout, bc_flush_none, bc_program_ready_msg); - if (BC_PROMPT) bc_file_puts(&vm->fout, bc_flush_none, prompt); - bc_file_flush(&vm->fout, bc_flush_none); +#ifndef _WIN32 + // We don't want to print anything on a SIGWINCH. + if (sig != SIGWINCH) +#endif // _WIN32 + { + // Print the ready message and prompt again. + bc_file_puts(&vm->fout, bc_flush_none, + bc_program_ready_msg); + if (BC_PROMPT) + { + bc_file_puts(&vm->fout, bc_flush_none, prompt); + } + bc_file_flush(&vm->fout, bc_flush_none); + } BC_SIG_UNLOCK; diff --git a/src/vector.c b/src/vector.c index c8b99b71b83c..5995dc7d3022 100644 --- a/src/vector.c +++ b/src/vector.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -418,7 +418,7 @@ bc_map_find(const BcVec* restrict v, const char* name) while (low < high) { - size_t mid = (low + high) / 2; + size_t mid = low + (high - low) / 2; const BcId* id = bc_vec_item(v, mid); int result = strcmp(name, id->name); @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -68,10 +68,12 @@ #endif // BC_ENABLE_LIBRARY #if !BC_ENABLE_LIBRARY + // The actual globals. char output_bufs[BC_VM_BUF_SIZE]; BcVm vm_data; BcVm* vm = &vm_data; + #endif // !BC_ENABLE_LIBRARY #if BC_DEBUG_CODE @@ -119,21 +121,36 @@ bc_vm_jmp(void) static void bc_vm_sig(int sig) { - // There is already a signal in flight. - if (vm->status == (sig_atomic_t) BC_STATUS_QUIT || vm->sig) +#if BC_ENABLE_EDITLINE + // Editline needs this to resize the terminal. This also needs to come first + // because a resize always needs to happen. + if (sig == SIGWINCH) { - if (!BC_I || sig != SIGINT) vm->status = BC_STATUS_QUIT; + if (BC_TTY) + { + el_resize(vm->history.el); + + // If the signal was a SIGWINCH, clear it because we don't need to + // print a stack trace in that case. + if (vm->sig == SIGWINCH) + { + vm->sig = 0; + } + } + return; } +#endif // BC_ENABLE_EDITLINE -#if BC_ENABLE_EDITLINE - // Editline needs this to resize the terminal. - if (sig == SIGWINCH) + // There is already a signal in flight if this is true. + if (vm->status == (sig_atomic_t) BC_STATUS_QUIT || vm->sig != 0) { - el_resize(vm->history.el); + if (!BC_I || sig != SIGINT) vm->status = BC_STATUS_QUIT; return; } -#endif // BC_ENABLE_EDITLINE + + // We always want to set this because a stack trace can be printed if we do. + vm->sig = sig; // Only reset under these conditions; otherwise, quit. if (sig == SIGINT && BC_SIGINT && BC_I) @@ -154,7 +171,6 @@ bc_vm_sig(int sig) { vm->status = BC_STATUS_ERROR_FATAL; } - else vm->sig = 1; errno = err; } @@ -198,7 +214,7 @@ bc_vm_sigaction(void) struct sigaction sa; sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_NODEFER; + sa.sa_flags = 0; // This mess is to silence a warning on Clang with regards to glibc's // sigaction handler, which activates the warning here. @@ -216,7 +232,7 @@ bc_vm_sigaction(void) #if BC_ENABLE_EDITLINE // Editline needs this to resize the terminal. - sigaction(SIGWINCH, &sa, NULL); + if (BC_TTY) sigaction(SIGWINCH, &sa, NULL); #endif // BC_ENABLE_EDITLINE #if BC_ENABLE_HISTORY @@ -333,8 +349,13 @@ bc_vm_handleError(BcErr e) BC_JMP; } #else // BC_ENABLE_LIBRARY +#ifndef NDEBUG +void +bc_vm_handleError(BcErr e, const char* file, int fline, size_t line, ...) +#else // NDEBUG void bc_vm_handleError(BcErr e, size_t line, ...) +#endif // NDEBUG { BcStatus s; va_list args; @@ -388,29 +409,25 @@ bc_vm_handleError(BcErr e, size_t line, ...) { bc_file_puts(&vm->ferr, bc_flush_none, "\n "); bc_file_puts(&vm->ferr, bc_flush_none, vm->file); - bc_file_printf(&vm->ferr, bc_err_line, line); + bc_file_printf(&vm->ferr, ":%zu\n", line); } else { - BcInstPtr* ip = bc_vec_item_rev(&vm->prog.stack, 0); - BcFunc* f = bc_vec_item(&vm->prog.fns, ip->func); - - bc_file_puts(&vm->ferr, bc_flush_none, "\n "); - bc_file_puts(&vm->ferr, bc_flush_none, vm->func_header); - bc_file_putchar(&vm->ferr, bc_flush_none, ' '); - bc_file_puts(&vm->ferr, bc_flush_none, f->name); - -#if BC_ENABLED - if (BC_IS_BC && ip->func != BC_PROG_MAIN && - ip->func != BC_PROG_READ) - { - bc_file_puts(&vm->ferr, bc_flush_none, "()"); - } -#endif // BC_ENABLED + // Print a stack trace. + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + bc_program_printStackTrace(&vm->prog); } } + else + { + bc_file_putchar(&vm->ferr, bc_flush_none, '\n'); + } + +#ifndef NDEBUG + bc_file_printf(&vm->ferr, "\n %s:%d\n", file, fline); +#endif // NDEBUG - bc_file_puts(&vm->ferr, bc_flush_none, "\n\n"); + bc_file_puts(&vm->ferr, bc_flush_none, "\n"); s = bc_file_flushErr(&vm->ferr, bc_flush_err); @@ -732,6 +749,25 @@ bc_vm_freeTemps(void) vm->temps_len = 0; } +#if !BC_ENABLE_LIBRARY + +size_t +bc_vm_numDigits(size_t val) +{ + size_t digits = 0; + + do + { + digits += 1; + val /= 10; + } + while (val != 0); + + return digits; +} + +#endif // !BC_ENABLE_LIBRARY + inline size_t bc_vm_arraySize(size_t n, size_t size) { @@ -929,7 +965,7 @@ bc_vm_clean(void) BcVec* fns = &vm->prog.fns; BcFunc* f = bc_vec_item(fns, BC_PROG_MAIN); BcInstPtr* ip = bc_vec_item(&vm->prog.stack, 0); - bool good = ((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig); + bool good = ((vm->status && vm->status != BC_STATUS_QUIT) || vm->sig != 0); BC_SIG_ASSERT_LOCKED; @@ -1331,8 +1367,6 @@ bc_vm_defaultMsgs(void) { size_t i; - vm->func_header = bc_err_func_header; - // Load the error categories. for (i = 0; i < BC_ERR_IDX_NELEMS + BC_ENABLED; ++i) { @@ -1355,7 +1389,7 @@ bc_vm_gettext(void) { #if BC_ENABLE_NLS uchar id = 0; - int set = 1, msg = 1; + int set, msg = 1; size_t i; // If no locale, load the defaults. @@ -1375,11 +1409,8 @@ bc_vm_gettext(void) return; } - // Load the function header. - vm->func_header = catgets(vm->catalog, set, msg, bc_err_func_header); - // Load the error categories. - for (set += 1; msg <= BC_ERR_IDX_NELEMS + BC_ENABLED; ++msg) + for (set = 1; msg <= BC_ERR_IDX_NELEMS + BC_ENABLED; ++msg) { vm->err_ids[msg - 1] = catgets(vm->catalog, set, msg, bc_errs[msg - 1]); } @@ -1389,13 +1420,13 @@ bc_vm_gettext(void) // Load the error messages. In order to understand this loop, you must know // the order of messages and categories in the enum and in the locale files. - for (set = id + 3, msg = 1; i < BC_ERR_NELEMS; ++i, ++msg) + for (set = id + 2, msg = 1; i < BC_ERR_NELEMS; ++i, ++msg) { if (id != bc_err_ids[i]) { msg = 1; id = bc_err_ids[i]; - set = id + 3; + set = id + 2; } vm->err_msgs[i] = catgets(vm->catalog, set, msg, bc_err_msgs[i]); diff --git a/tests/all.sh b/tests/all.sh index 76f2ac10ba1e..0ef8ae6cb49b 100755 --- a/tests/all.sh +++ b/tests/all.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/bc/timeconst.sh b/tests/bc/timeconst.sh index 8b6e1ec596fc..3751700077f7 100755 --- a/tests/bc/timeconst.sh +++ b/tests/bc/timeconst.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/bcl.c b/tests/bcl.c index 2de7d74c06f5..cea63f457cd4 100644 --- a/tests/bcl.c +++ b/tests/bcl.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2021 Gavin D. Howard and contributors. + * Copyright (c) 2018-2023 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/tests/error.sh b/tests/error.sh index b9c5bbe3be6e..35a6af0edf3f 100755 --- a/tests/error.sh +++ b/tests/error.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/errors.sh b/tests/errors.sh index 4acc978b9e5a..5005f3e9aeb1 100755 --- a/tests/errors.sh +++ b/tests/errors.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/history.py b/tests/history.py index f1787a27e864..b9acf73cb58d 100755 --- a/tests/history.py +++ b/tests/history.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/history.sh b/tests/history.sh index 1898ae5499dc..ff4ffa562ca8 100755 --- a/tests/history.sh +++ b/tests/history.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/other.sh b/tests/other.sh index c71189b9b323..fe228eec3317 100755 --- a/tests/other.sh +++ b/tests/other.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/read.sh b/tests/read.sh index a1915eb271ac..a5c66d9d4fec 100755 --- a/tests/read.sh +++ b/tests/read.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/script.sh b/tests/script.sh index f59daf343339..d720878fafa3 100755 --- a/tests/script.sh +++ b/tests/script.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/scripts.sh b/tests/scripts.sh index 46aa7e761170..ee21b2a9be6d 100755 --- a/tests/scripts.sh +++ b/tests/scripts.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/stdin.sh b/tests/stdin.sh index 69e6f2cabf34..d8585052bf04 100755 --- a/tests/stdin.sh +++ b/tests/stdin.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/tests/test.sh b/tests/test.sh index 8e292a524354..95606ded4f9e 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# Copyright (c) 2018-2023 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: |