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]

Re: cp/repo.c: Bugfix for filename handling


> 
> > 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.
> 
> file_name_nondirectory should be declared in cp-tree.h, not inside the
> function.
> 
> You should use it in open_repo_file, too.
> 
> Please use diff -p to generate patches.
> 
> Jason
> 

Here's an updated patch:

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

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

	* cp-tree.h (file_name_nondirectory): Add prototype.

*** repo.c	Thu Jun 25 18:06:09 1998
--- repo.c1	Thu Jun 25 11:44:52 1998
*************** extern int errorcount, sorrycount;
*** 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))
  
*************** get_base_filename (filename)
*** 259,269 ****
        return NULL;
      }
  
!   p = rindex (filename, '/');
!   if (p)
!     return p+1;
!   else
!     return filename;
  }        
  
  static void
--- 263,269 ----
        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, '.');
--- 276,282 ----
    if (s == NULL)
      return;
  
!   p = file_name_nondirectory (s);
    if (! p)
      p = s;
    p = rindex (p, '.');


*** cp-tree.h	Fri Jun 26 14:51:23 1998
--- cp-tree.h1	Fri Jun 26 14:59:31 1998
*************** extern tree current_class_type;	/* _TYPE
*** 2239,2244 ****
--- 2239,2245 ----
     operators represented by TREE_CODES.  For example,
     opname_tab[(int) MINUS_EXPR] == "-".  */
  extern char **opname_tab, **assignop_tab;
+ extern char *file_name_nondirectory		PROTO((char *));
  
  /* in call.c */
  extern int check_dtor_name			PROTO((tree, tree));

-- 
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]