version 1.4, 2004/12/02 19:23:44 |
version 1.5, 2004/12/03 19:01:02 |
|
|
int |
int |
cvs_logmsg_send(struct cvsroot *root, const char *msg) |
cvs_logmsg_send(struct cvsroot *root, const char *msg) |
{ |
{ |
const char *mp, *np; |
const char *mp; |
char buf[256]; |
char *np, buf[256]; |
|
|
if (cvs_sendarg(root, "-m", 0) < 0) |
if (cvs_sendarg(root, "-m", 0) < 0) |
return (-1); |
return (-1); |
|
|
for (np = msg; np != NULL; np = strchr(np, '\n')) { |
for (mp = msg; mp != NULL; mp = strchr(mp, '\n')) { |
if (*np == '\n') |
if (*mp == '\n') |
np++; |
mp++; |
|
|
/* XXX ghetto */ |
/* XXX ghetto */ |
strlcpy(buf, np, sizeof(buf)); |
strlcpy(buf, mp, sizeof(buf)); |
mp = strchr(buf, '\n'); |
np = strchr(buf, '\n'); |
if (mp != NULL) |
if (np != NULL) |
*mp = '\0'; |
*np = '\0'; |
if (cvs_sendarg(root, buf, (np == msg) ? 0 : 1) < 0) |
if (cvs_sendarg(root, buf, (mp == msg) ? 0 : 1) < 0) |
return (-1); |
return (-1); |
} |
} |
|
|