diff options
author | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-12-11 12:24:21 +0000 |
commit | b38569ff99f04a0eff4c8387273fafe38bb58c43 (patch) | |
tree | 2ed56a5cb810a4c08d41ea1babfef0e4a2c88b3e /contrib/cvs/src/edit.c | |
parent | 25155fc40f43750917e9621b6e4b57f72e19a29c (diff) | |
parent | 784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (diff) | |
download | FreeBSD-src-b38569ff99f04a0eff4c8387273fafe38bb58c43.zip FreeBSD-src-b38569ff99f04a0eff4c8387273fafe38bb58c43.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r54427,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/cvs/src/edit.c')
-rw-r--r-- | contrib/cvs/src/edit.c | 42 |
1 files changed, 29 insertions, 13 deletions
diff --git a/contrib/cvs/src/edit.c b/contrib/cvs/src/edit.c index aa0f4c4..59d363c 100644 --- a/contrib/cvs/src/edit.c +++ b/contrib/cvs/src/edit.c @@ -89,8 +89,8 @@ watch_onoff (argc, argv) if (local) send_arg ("-l"); - send_file_names (argc, argv, SEND_EXPAND_WILD); send_files (argc, argv, local, 0, SEND_NO_CONTENTS); + send_file_names (argc, argv, SEND_EXPAND_WILD); send_to_server (turning_on ? "watch-on\012" : "watch-off\012", 0); return get_responses_and_close (); } @@ -722,6 +722,9 @@ notify_proc (repository, filter) return (pclose (pipefp)); } +/* FIXME: this function should have a way to report whether there was + an error so that server.c can know whether to report Notified back + to the client. */ void notify_do (type, filename, who, val, watches, repository) int type; @@ -743,6 +746,11 @@ notify_do (type, filename, who, val, watches, repository) switch (type) { case 'E': + if (strpbrk (val, ",>;=\n") != NULL) + { + error (0, 0, "invalid character in editor value"); + return; + } editor_set (filename, who, val); break; case 'U': @@ -864,7 +872,14 @@ notify_do (type, filename, who, val, watches, repository) { char *cp; args.notifyee = xstrdup (line + len + 1); - cp = strchr (args.notifyee, ':'); + + /* There may or may not be more + colon-separated fields added to this in the + future; in any case, we ignore them right + now, and if there are none we make sure to + chop off the final newline, if any. */ + cp = strpbrk (args.notifyee, ":\n"); + if (cp != NULL) *cp = '\0'; break; @@ -876,7 +891,8 @@ notify_do (type, filename, who, val, watches, repository) error (0, errno, "cannot close %s", usersname); } free (usersname); - free (line); + if (line != NULL) + free (line); if (args.notifyee == NULL) { @@ -1008,29 +1024,29 @@ editors_fileproc (callerdat, finfo) if (them == NULL) return 0; - fputs (finfo->fullname, stdout); + cvs_output (finfo->fullname, 0); p = them; while (1) { - putc ('\t', stdout); + cvs_output ("\t", 1); while (*p != '>' && *p != '\0') - putc (*p++, stdout); + cvs_output (p++, 1); if (*p == '\0') { /* Only happens if attribute is misformed. */ - putc ('\n', stdout); + cvs_output ("\n", 1); break; } ++p; - putc ('\t', stdout); + cvs_output ("\t", 1); while (1) { while (*p != '+' && *p != ',' && *p != '\0') - putc (*p++, stdout); + cvs_output (p++, 1); if (*p == '\0') { - putc ('\n', stdout); + cvs_output ("\n", 1); goto out; } if (*p == ',') @@ -1039,9 +1055,9 @@ editors_fileproc (callerdat, finfo) break; } ++p; - putc ('\t', stdout); + cvs_output ("\t", 1); } - putc ('\n', stdout); + cvs_output ("\n", 1); } out:; return 0; @@ -1086,8 +1102,8 @@ editors (argc, argv) if (local) send_arg ("-l"); - send_file_names (argc, argv, SEND_EXPAND_WILD); send_files (argc, argv, local, 0, SEND_NO_CONTENTS); + send_file_names (argc, argv, SEND_EXPAND_WILD); send_to_server ("editors\012", 0); return get_responses_and_close (); } |