New macro uc_property_is_valid.
[pspp] / lib / striconv.c
index 7c4f549cf6ffd0ba5e5b48623b94abddba25ee04..ea4fa2979edce1a03b042e608fa64c44eca136ae 100644 (file)
@@ -31,7 +31,6 @@
 # include <limits.h>
 #endif
 
-#include "strdup.h"
 #include "c-strcase.h"
 
 #ifndef SIZE_MAX
@@ -397,7 +396,7 @@ str_cd_iconv (const char *src, iconv_t cd)
 char *
 str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
 {
-  if (c_strcasecmp (from_codeset, to_codeset) == 0)
+  if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
     {
       char *result = strdup (src);