summaryrefslogtreecommitdiff
path: root/Src/utils.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2014-06-09 09:50:37 +0100
committerPeter Stephenson <pws@zsh.org>2014-06-09 09:50:37 +0100
commit6336347c9e02ebae565b2d62987d1052bcba5567 (patch)
treec57790ed50fa12ab04733286bd10990d59fb13d0 /Src/utils.c
parent2ba4aa275e548ae9d4406e3bc8008bdfa1ce29eb (diff)
parent4f4d2b8247ef08e34fe73d91c0a8d8a2eb1f18c7 (diff)
downloadzsh-6336347c9e02ebae565b2d62987d1052bcba5567.tar.gz
zsh-6336347c9e02ebae565b2d62987d1052bcba5567.zip
fix my own merge conflict with grammar changes
Diffstat (limited to 'Src/utils.c')
-rw-r--r--Src/utils.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/Src/utils.c b/Src/utils.c
index 8b512bbd9..cef2abef8 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -2712,8 +2712,11 @@ ztrftimebuf(int *bufsizeptr, int decr)
mod_export int
ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
{
- int hr12, decr;
-#ifndef HAVE_STRFTIME
+ int hr12;
+#ifdef HAVE_STRFTIME
+ int decr;
+ char tmp[4];
+#else
static char *astr[] =
{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
static char *estr[] =
@@ -2721,7 +2724,6 @@ ztrftime(char *buf, int bufsize, char *fmt, struct tm *tm)
"Aug", "Sep", "Oct", "Nov", "Dec"};
#endif
char *origbuf = buf;
- char tmp[4];
while (*fmt)
@@ -4287,7 +4289,7 @@ zreaddir(DIR *dir, int ignoredots)
#if defined(HAVE_ICONV) && defined(__APPLE__)
if (!conv_ds)
conv_ds = iconv_open("UTF-8", "UTF-8-MAC");
- if (conv_ds) {
+ if (conv_ds != (iconv_t)(-1)) {
/* Force initial state in case re-using conv_ds */
(void) iconv(conv_ds, 0, &orig_name_len, 0, &conv_name_len);
@@ -4298,12 +4300,11 @@ zreaddir(DIR *dir, int ignoredots)
conv_name_len = orig_name_len;
if (iconv(conv_ds,
&orig_name_ptr, &orig_name_len,
- &conv_name_ptr, &conv_name_len) >= 0) {
- if (orig_name_len == 0) {
+ &conv_name_ptr, &conv_name_len) != (size_t)(-1) &&
+ orig_name_len == 0) {
/* Completely converted, metafy and return */
*conv_name_ptr = '\0';
return metafy(conv_name, -1, META_STATIC);
- }
}
/* Error, or conversion incomplete, keep the original name */
}