only a partial solution but a step in the right direction.
case 'U':
username = (char *) strdup(optarg);
break;
+#ifdef HAVE_ICONV_H
case 'F':
charset_from = (char *) strdup(optarg);
break;
case 'T':
charset_to = (char *) strdup(optarg);
break;
+#endif
case ':':
usage();
printf("missing argument!\n");
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(1);
}
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(1);
}
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(1);
}
if (del)
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(1);
}
if (verbose > 1)
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(1);
}
if (verbose > 1)
free(username);
if (password)
free(password);
+#ifdef HAVE_ICONV_H
if (charset_from)
iconv_close(iconv_d);
+#endif
exit(0);
}