From 5ef1d7b949abfce3a363a1170746e6cd1f950486 Mon Sep 17 00:00:00 2001 From: Steven Schweda Date: Fri, 11 Sep 2009 19:41:57 -0700 Subject: [PATCH] Fixes needed for VMS. --- src/ChangeLog | 14 ++++++++++++++ src/ftp.c | 14 ++++++++++++++ src/http.c | 4 ++-- src/main.c | 6 ++++-- src/utils.c | 2 +- src/utils.h | 2 +- 6 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 5981e779..f2ddf258 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2009-09-11 Steven Schweda + + * utils.c, utils.h (fopen_excl): Make second argument an int, + rather than a bool (so it can handle the appropriate VMS version + of the flag). + + * main.c (print_version): Don't print LOCALEDIR unless NLS is + enabled. + + * http.c (gethttp): Pass FOPEN_BIN_FLAG, instead of true. + + * ftp.c (ftp_retrieve_glob): Cast strcmp to assign to cmp, for a + silly HP build environment. + 2009-09-08 Steven Schubiger * main.c, init.c: Mark the --preserve-permissions and diff --git a/src/ftp.c b/src/ftp.c index 38f439fb..9d4344a8 100644 --- a/src/ftp.c +++ b/src/ftp.c @@ -2050,8 +2050,22 @@ ftp_retrieve_glob (struct url *u, ccon *con, int action) } else if (action == GLOB_GETONE) { +#ifdef __VMS + /* 2009-09-09 SMS. + * Odd-ball compiler ("HP C V7.3-009 on OpenVMS Alpha V7.3-2") + * bug causes spurious %CC-E-BADCONDIT complaint with this + * "?:" statement. (Different linkage attributes for strcmp() + * and strcasecmp().) Converting to "if" changes the + * complaint to %CC-W-PTRMISMATCH on "cmp = strcmp;". Adding + * the senseless type cast clears the complaint, and looks + * harmless. + */ + int (*cmp) (const char *, const char *) + = opt.ignore_case ? strcasecmp : (int (*)())strcmp; +#else /* def __VMS */ int (*cmp) (const char *, const char *) = opt.ignore_case ? strcasecmp : strcmp; +#endif /* def __VMS [else] */ f = start; while (f) { diff --git a/src/http.c b/src/http.c index 1b579bf1..dfe03ce0 100644 --- a/src/http.c +++ b/src/http.c @@ -2300,7 +2300,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); # define FOPEN_OPT_ARGS "fop=sqo", "acc", acc_cb, &open_id # define FOPEN_BIN_FLAG 3 #else /* def __VMS */ -# define FOPEN_BIN_FLAG 1 +# define FOPEN_BIN_FLAG true #endif /* def __VMS [else] */ /* Open the local file. */ @@ -2333,7 +2333,7 @@ File %s already there; not retrieving.\n\n"), quote (hs->local_file)); } else { - fp = fopen_excl (hs->local_file, true); + fp = fopen_excl (hs->local_file, FOPEN_BIN_FLAG); if (!fp && errno == EEXIST) { /* We cannot just invent a new name and use it (which is diff --git a/src/main.c b/src/main.c index 7040738a..c74f6ca3 100644 --- a/src/main.c +++ b/src/main.c @@ -825,9 +825,11 @@ print_version (void) printf (_(" %s (system)\n"), SYSTEM_WGETRC); #endif +#ifdef ENABLE_NLS format_and_print_line (locale_title, - LOCALEDIR, - MAX_CHARS_PER_LINE); + LOCALEDIR, + MAX_CHARS_PER_LINE); +#endif /* def ENABLE_NLS */ format_and_print_line (compile_title, compilation_string, diff --git a/src/utils.c b/src/utils.c index 4060aa50..a9d729d4 100644 --- a/src/utils.c +++ b/src/utils.c @@ -698,7 +698,7 @@ unique_create (const char *name, bool binary, char **opened_name) appropriately. */ FILE * -fopen_excl (const char *fname, bool binary) +fopen_excl (const char *fname, int binary) { int fd; #ifdef O_EXCL diff --git a/src/utils.h b/src/utils.h index 4a31b378..a645d52d 100644 --- a/src/utils.h +++ b/src/utils.h @@ -84,7 +84,7 @@ wgint file_size (const char *); int make_directory (const char *); char *unique_name (const char *, bool); FILE *unique_create (const char *, bool, char **); -FILE *fopen_excl (const char *, bool); +FILE *fopen_excl (const char *, int); char *file_merge (const char *, const char *); int fnmatch_nocase (const char *, const char *, int); -- 2.39.2