aboutsummaryrefslogtreecommitdiffstats
path: root/community/plymouth/plymouth-rpmatch.patch
blob: f6e1948747eddf858a3e239282aa0159f39de821 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--- plymouth-0.8.3.orig/src/libply/ply-command-parser.c
+++ plymouth-0.8.3/src/libply/ply-command-parser.c
@@ -671,6 +671,14 @@
   return argument[0] == '-' && argument[1] == '-';
 }
 
+static inline 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 bool
 ply_command_option_read_arguments (ply_command_option_t *option,
                                    ply_list_t           *arguments)