Skip to content
Snippets Groups Projects
Commit 3f94ff54 authored by Bruce Momjian's avatar Bruce Momjian
Browse files

Allow contrib/dbase to compile if HAVE_ICONV_H it not defined. This is

only a partial solution but a step in the right direction.
parent eb36cdd5
No related branches found
No related tags found
No related merge requests found
...@@ -742,12 +742,14 @@ main(int argc, char **argv) ...@@ -742,12 +742,14 @@ main(int argc, char **argv)
case 'U': case 'U':
username = (char *) strdup(optarg); username = (char *) strdup(optarg);
break; break;
#ifdef HAVE_ICONV_H
case 'F': case 'F':
charset_from = (char *) strdup(optarg); charset_from = (char *) strdup(optarg);
break; break;
case 'T': case 'T':
charset_to = (char *) strdup(optarg); charset_to = (char *) strdup(optarg);
break; break;
#endif
case ':': case ':':
usage(); usage();
printf("missing argument!\n"); printf("missing argument!\n");
...@@ -806,8 +808,10 @@ main(int argc, char **argv) ...@@ -806,8 +808,10 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(1); exit(1);
} }
...@@ -846,8 +850,10 @@ main(int argc, char **argv) ...@@ -846,8 +850,10 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(1); exit(1);
} }
...@@ -864,8 +870,10 @@ main(int argc, char **argv) ...@@ -864,8 +870,10 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(1); exit(1);
} }
if (del) if (del)
...@@ -880,8 +888,10 @@ main(int argc, char **argv) ...@@ -880,8 +888,10 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(1); exit(1);
} }
if (verbose > 1) if (verbose > 1)
...@@ -903,8 +913,10 @@ main(int argc, char **argv) ...@@ -903,8 +913,10 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(1); exit(1);
} }
if (verbose > 1) if (verbose > 1)
...@@ -933,7 +945,9 @@ main(int argc, char **argv) ...@@ -933,7 +945,9 @@ main(int argc, char **argv)
free(username); free(username);
if (password) if (password)
free(password); free(password);
#ifdef HAVE_ICONV_H
if (charset_from) if (charset_from)
iconv_close(iconv_d); iconv_close(iconv_d);
#endif
exit(0); exit(0);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment