summaryrefslogtreecommitdiffstats
path: root/src/pacman/util.c
diff options
context:
space:
mode:
authorAurelien Foret <aurelien@archlinux.org>2006-02-04 11:34:27 +0100
committerAurelien Foret <aurelien@archlinux.org>2006-02-04 11:34:27 +0100
commit633c89b5327bbdb14d0d076cbab474c60dabab57 (patch)
tree6d6294f69393fbecdc276665ea7ad87288c71bae /src/pacman/util.c
parentfe0b4cccb2539165657b7f06bb0a6a1123377798 (diff)
downloadpacman-633c89b5327bbdb14d0d076cbab474c60dabab57.tar.gz
pacman-633c89b5327bbdb14d0d076cbab474c60dabab57.tar.xz
- moved yesno() from util.c to log.c
- fixed a missing line feed in yesno when printing the message
Diffstat (limited to 'src/pacman/util.c')
-rw-r--r--src/pacman/util.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 16939099..757244a5 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -40,7 +40,6 @@
#include "conf.h"
extern int maxcols;
-extern int neednl;
extern config_t *config;
/* does the same thing as 'mkdir -p' */
@@ -189,45 +188,6 @@ char *strtrim(char *str)
return str;
}
-/* presents a prompt and gets a Y/N answer
- */
-int yesno(char *fmt, ...)
-{
- char response[32];
- va_list args;
-
- if(config->noconfirm) {
- return(1);
- }
-
- va_start(args, fmt);
- vprintf(fmt, args);
- va_end(args);
- fflush(stdout);
- neednl = 1;
- if(fgets(response, 32, stdin)) {
- /* trim whitespace and newlines */
- char *pch = response;
- while(isspace(*pch)) {
- pch++;
- }
- if(pch != response) {
- memmove(response, pch, strlen(pch) + 1);
- }
- pch = response + strlen(response) - 1;
- while(isspace(*pch)) {
- pch--;
- }
- *++pch = 0;
- strtrim(response);
-
- if(!strcasecmp(response, "Y") || !strcasecmp(response, "YES") || !strlen(response)) {
- return(1);
- }
- }
- return(0);
-}
-
/* match a string against a regular expression */
int reg_match(char *string, char *pattern)
{