Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4973 right-hear 1
#include 
2
#include 		/* For FILENAME_MAX */
3
#include 		/* For errno */
4
#include 		/* For strlen() */
5
#include 
6
#include 
7
 
8
static inline int is_slash(char c)
9
{
10
 return c=='/' || c=='\\';
11
}
12
 
13
void fix_slashes(char * in,char * out)
14
{
15
 int slash_count;
16
 for(slash_count=1;in && out && *in;in++)
17
 {
18
  if(is_slash(*in))
19
  {
20
   slash_count++;
21
   continue;
22
  } else {
23
   if(slash_count)
24
   {
25
    slash_count=0;
26
    *out++='/';
27
   }
28
   *out++=*in;
29
  }
30
 }
31
 *out='\0';
32
}
33
 
34
char * __libc_combine_path(char * c);
35
 
36
void _fixpath(const char *in, char *out)
37
{
38
 char * combined;
39
 combined=__libc_combine_path((char *)in);
40
 fix_slashes(combined,out);
41
}