This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

cp/repo.c: Bugfix for filename handling


The current handling of filenames assumes unix/dos like
filenames. This fails on VMS (see egcs/1997-Dec/1051.html)

Here's a fix.

Mon Jun  8 16:24:42 1998  Klaus Kaempf (kkaempf@progis.de)

	* repo.c (get_base_filename): Use file_name_nondirectory().
	(DIR_SEPARATOR): Define.
	(open_repo_file): Use DIR_SEPARATOR.

===================================================================
RCS file: RCS/repo.c,v
retrieving revision 1.1
diff -c -r1.1 repo.c
*** repo.c	1998/06/08 14:12:10	1.1
--- repo.c	1998/06/08 14:29:05
***************
*** 54,59 ****
--- 54,63 ----
  extern struct obstack temporary_obstack;
  extern struct obstack permanent_obstack;
  
+ #ifndef DIR_SEPARATOR
+ #define DIR_SEPARATOR '/'
+ #endif
+ 
  #define IDENTIFIER_REPO_USED(NODE)   (TREE_LANG_FLAG_3 (NODE))
  #define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
  
***************
*** 238,243 ****
--- 242,248 ----
    char *p = getenv ("COLLECT_GCC_OPTIONS");
    char *output = NULL;
    int compiling = 0;
+   extern char *file_name_nondirectory ();
  
    while (p && *p)
      {
***************
*** 259,270 ****
        return NULL;
      }
  
!   p = rindex (filename, '/');
!   if (p)
!     return p+1;
!   else
!     return filename;
! }        
  
  static void
  open_repo_file (filename)
--- 264,271 ----
        return NULL;
      }
  
!   return file_name_nondirectory (filename);
! }
  
  static void
  open_repo_file (filename)
***************
*** 276,282 ****
    if (s == NULL)
      return;
  
!   p = rindex (s, '/');
    if (! p)
      p = s;
    p = rindex (p, '.');
--- 277,283 ----
    if (s == NULL)
      return;
  
!   p = rindex (s, DIR_SEPARATOR);
    if (! p)
      p = s;
    p = rindex (p, '.');

-- 
proGIS Software                 E-Mail: kkaempf@progis.de
Dipl.-Inform. Klaus K"ampf      Fax:    0241-47067-29
Jakobstr. 117                   Voice:  0241-47067-11
D-52064 Aachen                  WWW:	http://www.progis.de



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]