/* If PATTERN is of the form archive:file, return a pointer to the
separator. If not, return NULL. */
-static char *
+static const char *
archive_path (const char *pattern)
{
- char *p = NULL;
+ const char *p = NULL;
if (link_info.path_separator == 0)
return p;
return whether F matches FILE_SPEC. */
static bool
-input_statement_is_archive_path (const char *file_spec, char *sep,
+input_statement_is_archive_path (const char *file_spec, const char *sep,
lang_input_statement_type *f)
{
bool match = false;
if (sep != file_spec)
{
const char *aname = bfd_get_filename (f->the_bfd->my_archive);
- *sep = 0;
+ /* SEP which points into FILE_SPEC is in writable memory. */
+ *(char *) sep = 0;
match = name_match (file_spec, aname) == 0;
- *sep = link_info.path_separator;
+ *(char *) sep = link_info.path_separator;
}
}
return match;
list_tmp;
list_tmp = list_tmp->next)
{
- char *p = archive_path (list_tmp->name);
+ const char *p = archive_path (list_tmp->name);
if (p != NULL)
{
{
struct wildcard_list *sec;
const char *file_spec = ptr->filename;
- char *p;
+ const char *p;
/* Check if filenames match. */
if (file_spec == NULL)
#ifdef HAVE_DOS_BASED_FILE_SYSTEM
{
/* We could have foo/bar\\baz, or foo\\bar, or d:bar. */
- char *bslash = strrchr (path, '\\');
+ const char *bslash = strrchr (path, '\\');
if (slash == NULL || (bslash != NULL && bslash > slash))
slash = bslash;