diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-11-23 07:53:24 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-11-24 23:58:22 +0100 |
commit | dbadaebfc4e9d453232795f54d4fe5618cf8e84d (patch) | |
tree | 5899d1f99ce0d767d28d753e6e6552896d47d01f /lib/setup-vms.h | |
parent | bc7e08471c1884a5100b6e0513a006c263ec3c6b (diff) | |
download | curl-dbadaebfc4e9d453232795f54d4fe5618cf8e84d.tar.gz |
checksrc: code style: use 'char *name' style
Diffstat (limited to 'lib/setup-vms.h')
-rw-r--r-- | lib/setup-vms.h | 77 |
1 files changed, 39 insertions, 38 deletions
diff --git a/lib/setup-vms.h b/lib/setup-vms.h index 4b78e0bf0..ae6c63bf3 100644 --- a/lib/setup-vms.h +++ b/lib/setup-vms.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -41,7 +41,7 @@ # endif #endif #include <stdlib.h> - char * decc$getenv(const char * __name); +char *decc$getenv(const char *__name); #include <pwd.h> #include <string.h> @@ -79,23 +79,24 @@ # if __INITIAL_POINTER_SIZE == 32 /* Translate the path, but only if the path is a VMS file specification */ /* The translation is usually only needed for older versions of VMS */ -static char * vms_translate_path(const char * path) { -char * unix_path; -char * test_str; - - /* See if the result is in VMS format, if not, we are done */ - /* Assume that this is a PATH, not just some data */ - test_str = strpbrk(path, ":[<^"); - if(test_str == NULL) { - return (char *)path; - } - - unix_path = decc$translate_vms(path); - - if((int)unix_path <= 0) { - /* We can not translate it, so return the original string */ - return (char *)path; - } +static char *vms_translate_path(const char *path) +{ + char *unix_path; + char *test_str; + + /* See if the result is in VMS format, if not, we are done */ + /* Assume that this is a PATH, not just some data */ + test_str = strpbrk(path, ":[<^"); + if(test_str == NULL) { + return (char *)path; + } + + unix_path = decc$translate_vms(path); + + if((int)unix_path <= 0) { + /* We can not translate it, so return the original string */ + return (char *)path; + } } # else /* VMS translate path is actually not needed on the current 64 bit */ @@ -111,27 +112,27 @@ char * test_str; # endif #endif -static char * vms_getenv(const char * envvar) { +static char *vms_getenv(const char *envvar) +{ + char *result; + char *vms_path; -char * result; -char * vms_path; - - /* first use the DECC getenv() function */ - result = decc$getenv(envvar); - if(result == NULL) { - return result; - } + /* first use the DECC getenv() function */ + result = decc$getenv(envvar); + if(result == NULL) { + return result; + } - vms_path = result; - result = vms_translate_path(vms_path); + vms_path = result; + result = vms_translate_path(vms_path); - /* note that if you backport this to use VAX C RTL, that the VAX C RTL */ - /* may do a malloc(2048) for each call to getenv(), so you will need */ - /* to add a free(vms_path) */ - /* Do not do a free() for DEC C RTL builds, which should be used for */ - /* VMS 5.5-2 and later, even if using GCC */ + /* note that if you backport this to use VAX C RTL, that the VAX C RTL */ + /* may do a malloc(2048) for each call to getenv(), so you will need */ + /* to add a free(vms_path) */ + /* Do not do a free() for DEC C RTL builds, which should be used for */ + /* VMS 5.5-2 and later, even if using GCC */ - return result; + return result; } @@ -146,10 +147,10 @@ struct passwd * my_passwd; # if __INITIAL_POINTER_SIZE __char_ptr32 unix_path; # else -char * unix_path; +char *unix_path; # endif #else -char * unix_path; +char *unix_path; #endif my_passwd = decc_getpwuid(uid); |