+2019-01-23 Akim Demaille <akim.demaille@gmail.com>
+ Bruno Haible <bruno@clisp.org>
+
+ relocatable: avoid compiler warnings (-Wshadow)
+ * lib/relocatable.c (compute_curr_prefix): Rename local variables
+ to avoid name collisions with global variables.
+
2019-01-22 Bruno Haible <bruno@clisp.org>
vasnprintf: Don't use %n on Android.
}
if (!same)
break;
- /* The last pathname component was the same. opi and cpi now point
+ /* The last pathname component was the same. rpi and cpi now point
to the slash before it. */
rp = rpi;
cp = cpi;
}
{
- size_t curr_prefix_len = cp - curr_installdir;
- char *curr_prefix;
+ size_t computed_curr_prefix_len = cp - curr_installdir;
+ char *computed_curr_prefix;
- curr_prefix = (char *) xmalloc (curr_prefix_len + 1);
+ computed_curr_prefix = (char *) xmalloc (computed_curr_prefix_len + 1);
#ifdef NO_XMALLOC
- if (curr_prefix == NULL)
+ if (computed_curr_prefix == NULL)
{
free (curr_installdir);
return NULL;
}
#endif
- memcpy (curr_prefix, curr_installdir, curr_prefix_len);
- curr_prefix[curr_prefix_len] = '\0';
+ memcpy (computed_curr_prefix, curr_installdir, computed_curr_prefix_len);
+ computed_curr_prefix[computed_curr_prefix_len] = '\0';
free (curr_installdir);
- return curr_prefix;
+ return computed_curr_prefix;
}
}
}