0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-01-06 02:26:34 +00:00
termux-packages/packages/aptitude/0104-fill-rpmatch.patch
Chongyun Lee a734bf2478 new package: aptitude
Co-Authored-By: kawanakaiku <80381779+kawanakaiku@users.noreply.github.com>
2024-01-08 06:55:43 +08:00

18 lines
580 B
Diff

--- a/src/cmdline/cmdline_prompt.cc
+++ b/src/cmdline/cmdline_prompt.cc
@@ -62,6 +62,14 @@
using aptitude::why::make_cmdline_why_callbacks;
using aptitude::why::why_callbacks;
+// https://github.com/coreutils/gnulib/blob/2a5409cf2ac62ed273589c72bb8ae0031f06a219/lib/rpmatch.c#L126
+int
+rpmatch (const char *response)
+{
+ /* Test against "^[yY]" and "^[nN]", hardcoded to avoid requiring regex */
+ return (*response == 'y' || *response == 'Y' ? 1
+ : *response == 'n' || *response == 'N' ? 0 : -1);
+}
static string reason_string_list(set<reason> &reasons)
{