summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-01-21 12:57:07 +0100
committerVolker Lendecke <vl@samba.org>2010-01-21 12:58:11 +0100
commit24d4433bd75366774945ed59c0043428dedea4ba (patch)
tree6980a0d36b1a44c91026f8b1f2b737154af04f31 /source3/client
parent3d40d8461efbd9010487f1ef6cbd72a5c4754f55 (diff)
downloadsamba-24d4433bd75366774945ed59c0043428dedea4ba.tar.gz
samba-24d4433bd75366774945ed59c0043428dedea4ba.tar.bz2
samba-24d4433bd75366774945ed59c0043428dedea4ba.zip
s3: Move "yesno" to the only place where it is used: client.c
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/client.c18
1 files changed, 18 insertions, 0 deletions
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
@@ -163,6 +163,24 @@ const char *client_set_cur_dir(const char *newdir)
}
/****************************************************************************
+ 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.
****************************************************************************/