From 24d4433bd75366774945ed59c0043428dedea4ba Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 21 Jan 2010 12:57:07 +0100 Subject: s3: Move "yesno" to the only place where it is used: client.c --- source3/client/client.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source3/client/client.c') diff --git a/source3/client/client.c b/source3/client/client.c index 504b1dd9b3..f177129dc7 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -162,6 +162,24 @@ const char *client_set_cur_dir(const char *newdir) return client_get_cur_dir(); } +/**************************************************************************** + Put up a yes/no prompt. +****************************************************************************/ + +static bool yesno(const char *p) +{ + char ans[20]; + printf("%s",p); + + if (!fgets(ans,sizeof(ans)-1,stdin)) + return(False); + + if (*ans == 'y' || *ans == 'Y') + return(True); + + return(False); +} + /**************************************************************************** Write to a local file with CR/LF->LF translation if appropriate. Return the number taken from the buffer. This may not equal the number written. -- cgit