1 |
slyfox 12/10/02 15:58:59 |
2 |
|
3 |
Added: cvsps-2.2_beta1-solaris.patch |
4 |
Log: |
5 |
Version bump by Jonas Bernoulli (stable versions are known to crash on real-world repositories). |
6 |
|
7 |
(Portage version: 2.2.0_alpha133_p5/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 dev-vcs/cvsps/files/cvsps-2.2_beta1-solaris.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-vcs/cvsps/files/cvsps-2.2_beta1-solaris.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-vcs/cvsps/files/cvsps-2.2_beta1-solaris.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: cvsps-2.2_beta1-solaris.patch |
16 |
=================================================================== |
17 |
Modified version of. |
18 |
http://cvs.openpkg.org/fileview?f=openpkg-src/cvsps/cvsps.patch&v=1.13 |
19 |
|
20 |
diff --git a/cache.c b/cache.c |
21 |
index 4c51cf7..2c3918d 100644 |
22 |
--- a/cache.c |
23 |
+++ b/cache.c |
24 |
@@ -361,7 +361,7 @@ static void parse_cache_revision(PatchSetMember * psm, const char * p_buff) |
25 |
|
26 |
strcpy(buff, p_buff); |
27 |
|
28 |
- while ((s = strsep(&p, ";"))) |
29 |
+ while ((s = my_strsep(&p, ";"))) |
30 |
{ |
31 |
char * c = strchr(s, ':'); |
32 |
|
33 |
diff --git a/cvs_direct.c b/cvs_direct.c |
34 |
index e281848..5aa8f0f 100644 |
35 |
--- a/cvs_direct.c |
36 |
+++ b/cvs_direct.c |
37 |
@@ -92,12 +92,12 @@ CvsServerCtx * open_cvs_server(char * p_root, int compress) |
38 |
|
39 |
strcpy_a(root, p_root, PATH_MAX); |
40 |
|
41 |
- tok = strsep(&p, ":"); |
42 |
+ tok = my_strsep(&p, ":"); |
43 |
|
44 |
/* if root string looks like :pserver:... then the first token will be empty */ |
45 |
if (strlen(tok) == 0) |
46 |
{ |
47 |
- char * method = strsep(&p, ":"); |
48 |
+ char * method = my_strsep(&p, ":"); |
49 |
if (strcmp(method, "pserver") == 0) |
50 |
{ |
51 |
ctx = open_ctx_pserver(ctx, p); |
52 |
@@ -185,14 +185,14 @@ static CvsServerCtx * open_ctx_pserver(CvsServerCtx * ctx, const char * p_root) |
53 |
|
54 |
strcpy_a(root, p_root, PATH_MAX); |
55 |
|
56 |
- tok = strsep(&p, ":"); |
57 |
+ tok = my_strsep(&p, ":"); |
58 |
if (strlen(tok) == 0 || !p) |
59 |
{ |
60 |
debug(DEBUG_APPERROR, "parse error on third token"); |
61 |
goto out_free_err; |
62 |
} |
63 |
|
64 |
- tok2 = strsep(&tok, "@"); |
65 |
+ tok2 = my_strsep(&tok, "@"); |
66 |
if (!strlen(tok2) || (!tok || !strlen(tok))) |
67 |
{ |
68 |
debug(DEBUG_APPERROR, "parse error on user@server in pserver"); |
69 |
@@ -272,7 +272,7 @@ static CvsServerCtx * open_ctx_forked(CvsServerCtx * ctx, const char * p_root) |
70 |
strcpy_a(root, p_root, PATH_MAX); |
71 |
|
72 |
/* if there's a ':', it's remote */ |
73 |
- tok = strsep(&p, ":"); |
74 |
+ tok = my_strsep(&p, ":"); |
75 |
|
76 |
if (p) |
77 |
{ |
78 |
@@ -281,7 +281,7 @@ static CvsServerCtx * open_ctx_forked(CvsServerCtx * ctx, const char * p_root) |
79 |
if (!cvs_rsh) |
80 |
cvs_rsh = "rsh"; |
81 |
|
82 |
- tok2 = strsep(&tok, "@"); |
83 |
+ tok2 = my_strsep(&tok, "@"); |
84 |
|
85 |
if (tok) |
86 |
snprintf(execcmd, PATH_MAX, "%s -l %s %s %s server", cvs_rsh, tok2, tok, cvs_server); |
87 |
@@ -776,7 +776,7 @@ void cvs_rupdate(CvsServerCtx * ctx, const char * rep, const char * file, const |
88 |
static int parse_patch_arg(char * arg, char ** str) |
89 |
{ |
90 |
char *tok, *tok2 = ""; |
91 |
- tok = strsep(str, " "); |
92 |
+ tok = my_strsep(str, " "); |
93 |
if (!tok) |
94 |
return 0; |
95 |
|
96 |
@@ -796,7 +796,7 @@ static int parse_patch_arg(char * arg, char ** str) |
97 |
/* see if command wants two args and they're separated by ' ' */ |
98 |
if (tok[2] == 0 && strchr("BdDFgiorVxYz", tok[1])) |
99 |
{ |
100 |
- tok2 = strsep(str, " "); |
101 |
+ tok2 = my_strsep(str, " "); |
102 |
if (!tok2) |
103 |
{ |
104 |
debug(DEBUG_APPERROR, "diff_opts parse_error: argument %s requires two arguments", tok); |
105 |
diff --git a/util.c b/util.c |
106 |
index 7884c84..f3ab3a3 100644 |
107 |
--- a/util.c |
108 |
+++ b/util.c |
109 |
@@ -316,3 +316,31 @@ void strcpy_a(char * dst, const char * src, int n) |
110 |
exit(1); |
111 |
} |
112 |
} |
113 |
+ |
114 |
+char *my_strsep(char **stringp, const char *delim) |
115 |
+{ |
116 |
+ char *s; |
117 |
+ const char *spanp; |
118 |
+ int c, sc; |
119 |
+ char *tok; |
120 |
+ |
121 |
+ if ((s = *stringp) == NULL) |
122 |
+ return NULL; |
123 |
+ for (tok = s;;) { |
124 |
+ c = *s++; |
125 |
+ spanp = delim; |
126 |
+ do { |
127 |
+ if ((sc = *spanp++) == c) { |
128 |
+ if (c == 0) |
129 |
+ s = NULL; |
130 |
+ else |
131 |
+ s[-1] = 0; |
132 |
+ *stringp = s; |
133 |
+ return tok; |
134 |
+ } |
135 |
+ } while (sc != 0); |
136 |
+ } |
137 |
+ /* NOTREACHED */ |
138 |
+ return NULL; |
139 |
+} |
140 |
+ |
141 |
diff --git a/util.h b/util.h |
142 |
index ff2d3a0..336fd63 100644 |
143 |
--- a/util.h |
144 |
+++ b/util.h |
145 |
@@ -24,5 +24,6 @@ void timing_stop(const char *); |
146 |
int my_system(const char *); |
147 |
int escape_filename(char *, int, const char *); |
148 |
void strcpy_a(char * dst, const char * src, int n); |
149 |
+char *my_strsep(char **, const char *); |
150 |
|
151 |
#endif /* UTIL_H */ |