FreeBASIC
0.91.0
Main Page
Data Structures
Files
File List
Globals
sys_getshortpath.c
Go to the documentation of this file.
1
#include "../fb.h"
2
3
char
*
fb_hGetShortPath
(
char
*src,
char
*dst, ssize_t maxlen )
4
{
5
if
( strchr( src, 32 ) ==
NULL
) {
6
strcpy( dst, src );
7
}
else
{
8
ssize_t i = 0;
9
char
*old_dst = dst;
10
11
while
((*src) && (i < maxlen - 1)) {
12
if
(*src ==
' '
) {
13
*dst++ =
'\\'
;
14
i++;
15
}
16
if
(i == maxlen - 1)
17
break
;
18
*dst++ = *src++;
19
i++;
20
}
21
dst = old_dst;
22
dst[maxlen - 1] =
'\0'
;
23
}
24
25
return
dst;
26
}
rtlib
unix
sys_getshortpath.c
Generated on Thu Jan 23 2014 19:40:10 for FreeBASIC by
1.8.4