"SfR Fresh" - the SfR Freeware/Shareware Archive 
Member "qftp-0.98/misc.cc" of archive qftp-0.98.tar.gz:
As a special service "SfR Fresh" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting with prefixed line numbers.
Alternatively you can here view or download the uninterpreted source code file.
That can be also achieved for any archive member file by clicking within an archive contents listing on the first character of the file(path) respectively on the according byte size field.
1 #include <ctype.h>
2 #include <string.h>
3
4 int procargs(char *s, char *f[])
5 {
6 char *p;
7 int i = 0, j;
8 p = s;
9
10 while (*p) {
11 f[i++] = p;
12 while (*p && !isspace(*p))
13 p++;
14 if (!*p)
15 break;
16 *p++ = 0;
17 while (*p && isspace(*p))
18 p++;
19 }
20 *p++ = 0;
21 *p = 0;
22 f[i] = 0;
23 for (j = i;j < 100;j++)
24 f[j] = 0;
25 return i;
26 }
27
28
29 char *split(char *cwd, char *s, char *path)
30 {
31 char *p, *p2, *p3;
32 if (s)
33 p = s;
34 else
35 p = "";
36 if (*p == '/') {
37 if (!(p2 = strrchr(&p[1], '/'))) {
38 p2 = &p[1];
39 p3 = p2;
40 } else
41 p3 = p2 + 1;
42
43 strncpy(path, p, p2 - p);
44 path[p2 - p] = 0;
45 p = p3;
46 } else {
47 if (!(p2 = strrchr(p, '/'))) {
48 strcpy(path, cwd);
49 } else {
50 strcpy(path, cwd);
51 p3 = path + strlen(path);
52 *p3++ = '/';
53 strncpy(p3, p, p2 - p);
54 p3[p2 - p] = 0;
55 p = p2 + 1;
56 }
57 }
58 return p;
59 }