PR binutils/1437
[deliverable/binutils-gdb.git] / gdb / source.c
index 063ffe590060e7d31571e774ba6083dd04e5c583..14051b71bae9dac7a92b217c11853ad55bf46f91 100644 (file)
@@ -1,6 +1,6 @@
 /* List lines of source files for GDB, the GNU debugger.
    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -251,12 +251,10 @@ select_source_symtab (struct symtab *s)
     {
       for (s = ofp->symtabs; s; s = s->next)
        {
-         char *name = s->filename;
+         const char *name = s->filename;
          int len = strlen (name);
-         if (!(len > 2 && (DEPRECATED_STREQ (&name[len - 2], ".h"))))
-           {
-             current_source_symtab = s;
-           }
+         if (!(len > 2 && strcmp(&name[len - 2], ".h") == 0))
+           current_source_symtab = s;
        }
     }
   if (current_source_symtab)
@@ -268,12 +266,10 @@ select_source_symtab (struct symtab *s)
     {
       for (ps = ofp->psymtabs; ps != NULL; ps = ps->next)
        {
-         char *name = ps->filename;
+         const char *name = ps->filename;
          int len = strlen (name);
-         if (!(len > 2 && (DEPRECATED_STREQ (&name[len - 2], ".h"))))
-           {
-             cs_pst = ps;
-           }
+         if (!(len > 2 && strcmp (&name[len - 2], ".h") == 0))
+           cs_pst = ps;
        }
     }
   if (cs_pst)
@@ -487,10 +483,10 @@ add_path (char *dirname, char **which_path, int parse_separators)
        name = tilde_expand (name);
 #ifdef HAVE_DOS_BASED_FILE_SYSTEM
       else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */
-       name = concat (name, ".", NULL);
+       name = concat (name, ".", (char *)NULL);
 #endif
       else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$')
-       name = concat (current_directory, SLASH_STRING, name, NULL);
+       name = concat (current_directory, SLASH_STRING, name, (char *)NULL);
       else
        name = savestring (name, p - name);
       make_cleanup (xfree, name);
@@ -563,15 +559,16 @@ add_path (char *dirname, char **which_path, int parse_separators)
 
                c = old[prefix];
                old[prefix] = '\0';
-               temp = concat (old, tinybuf, name, NULL);
+               temp = concat (old, tinybuf, name, (char *)NULL);
                old[prefix] = c;
-               *which_path = concat (temp, "", &old[prefix], NULL);
+               *which_path = concat (temp, "", &old[prefix], (char *)NULL);
                prefix = strlen (temp);
                xfree (temp);
              }
            else
              {
-               *which_path = concat (name, (old[0] ? tinybuf : old), old, NULL);
+               *which_path = concat (name, (old[0] ? tinybuf : old),
+                                     old, (char *)NULL);
                prefix = strlen (name);
              }
            xfree (old);
@@ -771,7 +768,7 @@ done:
          char *f = concat (current_directory,
                            IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
                            ? "" : SLASH_STRING,
-                           filename, NULL);
+                           filename, (char *)NULL);
          *filename_opened = xfullpath (f);
          xfree (f);
        }
This page took 0.02443 seconds and 4 git commands to generate.