aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-01-13 16:13:32 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-01-13 16:13:32 +0000
commitf1da9e508e049904f02cae246cdc844487bc8c0d (patch)
tree9c096804481f9abd0fafbb953cdfab35fadc9b0f
parent9e80356dd5f13c32dc265d3a499623134d95beb5 (diff)
indented and formatted the VMS-specific code more in the same style as
other curl code
-rw-r--r--src/getpass.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/getpass.c b/src/getpass.c
index 77e950c9d..975ce1dde 100644
--- a/src/getpass.c
+++ b/src/getpass.c
@@ -1,5 +1,4 @@
/* ============================================================================
- * Copyright (C) 1998 - 2002, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* Redistribution and use are freely permitted provided that:
*
@@ -30,8 +29,6 @@
*
* Author(s):
* Angus Mackay <amackay@gus.ml.org>
- *
- * Contributor(s):
* Daniel Stenberg <daniel@haxx.se>
*/
@@ -49,19 +46,25 @@
#include iosbdef
char *getpass_r(const char *prompt, char *buffer, size_t buflen)
{
- long sts;
- short chan;
- struct _iosb iosb;
- $DESCRIPTOR(ttdesc, "TT");
-
- buffer[0]='\0';
- if ((sts = sys$assign(&ttdesc, &chan,0,0)) & 1) {
- if (((sts = sys$qiow(0, chan, IO$_READPROMPT | IO$M_NOECHO, &iosb, 0, 0, buffer, buflen, 0, 0, prompt, strlen(prompt))) & 1) && (iosb.iosb$w_status&1)) {
- buffer[iosb.iosb$w_bcnt] = '\0';
- }
- sts = sys$dassgn(chan);
- }
- return buffer; /* we always return success */
+ long sts;
+ short chan;
+ struct _iosb iosb;
+ $DESCRIPTOR(ttdesc, "TT");
+
+ buffer[0]='\0';
+ sts = sys$assign(&ttdesc, &chan,0,0);
+ if (sts & 1) {
+ sts = sys$qiow(0, chan,
+ IO$_READPROMPT | IO$M_NOECHO,
+ &iosb, 0, 0, buffer, buflen, 0, 0,
+ prompt, strlen(prompt));
+
+ if((sts & 1) && (iosb.iosb$w_status&1))
+ buffer[iosb.iosb$w_bcnt] = '\0';
+
+ sts = sys$dassgn(chan);
+ }
+ return buffer; /* we always return success */
}
#else /* VMS */
#ifdef HAVE_TERMIOS_H