? fix-edit_fields_with_plus.diff
? vms/Makefile
Index: src/edit.c
===================================================================
RCS file: /home/nyap/.cvsroot/cvs/src/edit.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.8.1
diff -C16 -w -r1.1.1.1 -r1.1.1.1.8.1
*** src/edit.c	2001/03/06 16:21:21	1.1.1.1
--- src/edit.c	2001/03/08 13:22:04	1.1.1.1.8.1
***************
*** 175,211 ****
      }
  
      while (getline (&line, &line_len, fp) > 0)
      {
  	notif_type = line[0];
  	if (notif_type == '\0')
  	    continue;
  	filename = line + 1;
  	cp = strchr (filename, '\t');
  	if (cp == NULL)
  	    continue;
  	*cp++ = '\0';
  	val = cp;
  	cp = strchr (val, '\t');
  	if (cp == NULL)
  	    continue;
! 	*cp++ = '+';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    continue;
! 	*cp++ = '+';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    continue;
  	*cp++ = '\0';
  	watches = cp;
  	cp = strchr (cp, '\n');
  	if (cp == NULL)
  	    continue;
  	*cp = '\0';
  
  	notify_do (notif_type, filename, getcaller (), val, watches,
  		   finfo->repository);
      }
      free (line);
  
      if (ferror (fp))
--- 175,211 ----
      }
  
      while (getline (&line, &line_len, fp) > 0)
      {
  	notif_type = line[0];
  	if (notif_type == '\0')
  	    continue;
  	filename = line + 1;
  	cp = strchr (filename, '\t');
  	if (cp == NULL)
  	    continue;
  	*cp++ = '\0';
  	val = cp;
  	cp = strchr (val, '\t');
  	if (cp == NULL)
  	    continue;
! 	*cp++ = '&';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    continue;
! 	*cp++ = '&';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    continue;
  	*cp++ = '\0';
  	watches = cp;
  	cp = strchr (cp, '\n');
  	if (cp == NULL)
  	    continue;
  	*cp = '\0';
  
  	notify_do (notif_type, filename, getcaller (), val, watches,
  		   finfo->repository);
      }
      free (line);
  
      if (ferror (fp))
***************
*** 414,452 ****
  	    case '?':
  	    default:
  		usage (edit_usage);
  		break;
  	}
      }
      argc -= optind;
      argv += optind;
  
      if (a_omitted)
      {
  	setting_tedit = 1;
  	setting_tunedit = 1;
  	setting_tcommit = 1;
      }
  
!     if (strpbrk (hostname, "+,>;=\t\n") != NULL)
  	error (1, 0,
! 	       "host name (%s) contains an invalid character (+,>;=\\t\\n)",
  	       hostname);
!     if (strpbrk (CurDir, "+,>;=\t\n") != NULL)
  	error (1, 0,
! "current directory (%s) contains an invalid character (+,>;=\\t\\n)",
  	       CurDir);
  
      /* No need to readlock since we aren't doing anything to the
         repository.  */
      err = start_recursion (edit_fileproc, (FILESDONEPROC) NULL,
  			   (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
  			   argc, argv, local, W_LOCAL, 0, 0, (char *)NULL,
  			   0);
  
      err += send_notifications (argc, argv, local);
  
      return err;
  }
  
  static int unedit_fileproc PROTO ((void *callerdat, struct file_info *finfo));
  
--- 414,452 ----
  	    case '?':
  	    default:
  		usage (edit_usage);
  		break;
  	}
      }
      argc -= optind;
      argv += optind;
  
      if (a_omitted)
      {
  	setting_tedit = 1;
  	setting_tunedit = 1;
  	setting_tcommit = 1;
      }
  
!     if (strpbrk (hostname, "&,>;=\t\n") != NULL)
  	error (1, 0,
! 	       "host name (%s) contains an invalid character (&,>;=\\t\\n)",
  	       hostname);
!     if (strpbrk (CurDir, "&,>;=\t\n") != NULL)
  	error (1, 0,
! "current directory (%s) contains an invalid character (&,>;=\\t\\n)",
  	       CurDir);
  
      /* No need to readlock since we aren't doing anything to the
         repository.  */
      err = start_recursion (edit_fileproc, (FILESDONEPROC) NULL,
  			   (DIRENTPROC) NULL, (DIRLEAVEPROC) NULL, NULL,
  			   argc, argv, local, W_LOCAL, 0, 0, (char *)NULL,
  			   0);
  
      err += send_notifications (argc, argv, local);
  
      return err;
  }
  
  static int unedit_fileproc PROTO ((void *callerdat, struct file_info *finfo));
  
***************
*** 795,827 ****
  
  	if ((size_t)(endp - p) == strlen (who) && strncmp (who, p, endp - p) == 0)
  	{
  	    /* Don't notify user of their own changes.  Would perhaps
  	       be better to check whether it is the same working
  	       directory, not the same user, but that is hairy.  */
  	    p = nextp == NULL ? nextp : nextp + 1;
  	    continue;
  	}
  
  	/* Now we point q at a string which looks like
  	   "edit+unedit+commit,"... and walk down it.  */
  	q = endp + 1;
  	notif = NULL;
  	while (q != NULL)
  	{
! 	    endq = strchr (q, '+');
  	    if (endq == NULL || (nextp != NULL && endq > nextp))
  	    {
  		if (nextp == NULL)
  		    endq = q + strlen (q);
  		else
  		    endq = nextp;
  		nextq = NULL;
  	    }
  	    else
  		nextq = endq + 1;
  
  	    /* If there is a temporary and a regular watch, send a single
  	       notification, for the regular watch.  */
  	    if (type == 'E' && endq - q == 4 && strncmp ("edit", q, 4) == 0)
  	    {
  		notif = "edit";
--- 795,827 ----
  
  	if ((size_t)(endp - p) == strlen (who) && strncmp (who, p, endp - p) == 0)
  	{
  	    /* Don't notify user of their own changes.  Would perhaps
  	       be better to check whether it is the same working
  	       directory, not the same user, but that is hairy.  */
  	    p = nextp == NULL ? nextp : nextp + 1;
  	    continue;
  	}
  
  	/* Now we point q at a string which looks like
  	   "edit+unedit+commit,"... and walk down it.  */
  	q = endp + 1;
  	notif = NULL;
  	while (q != NULL)
  	{
! 	    endq = strchr (q, '&');
  	    if (endq == NULL || (nextp != NULL && endq > nextp))
  	    {
  		if (nextp == NULL)
  		    endq = q + strlen (q);
  		else
  		    endq = nextp;
  		nextq = NULL;
  	    }
  	    else
  		nextq = endq + 1;
  
  	    /* If there is a temporary and a regular watch, send a single
  	       notification, for the regular watch.  */
  	    if (type == 'E' && endq - q == 4 && strncmp ("edit", q, 4) == 0)
  	    {
  		notif = "edit";
***************
*** 1047,1079 ****
      p = them;
      while (1)
      {
  	cvs_output ("\t", 1);
  	while (*p != '>' && *p != '\0')
  	    cvs_output (p++, 1);
  	if (*p == '\0')
  	{
  	    /* Only happens if attribute is misformed.  */
  	    cvs_output ("\n", 1);
  	    break;
  	}
  	++p;
  	cvs_output ("\t", 1);
  	while (1)
  	{
! 	    while (*p != '+' && *p != ',' && *p != '\0')
  		cvs_output (p++, 1);
  	    if (*p == '\0')
  	    {
  		cvs_output ("\n", 1);
  		goto out;
  	    }
  	    if (*p == ',')
  	    {
  		++p;
  		break;
  	    }
  	    ++p;
  	    cvs_output ("\t", 1);
  	}
  	cvs_output ("\n", 1);
      }
--- 1047,1079 ----
      p = them;
      while (1)
      {
  	cvs_output ("\t", 1);
  	while (*p != '>' && *p != '\0')
  	    cvs_output (p++, 1);
  	if (*p == '\0')
  	{
  	    /* Only happens if attribute is misformed.  */
  	    cvs_output ("\n", 1);
  	    break;
  	}
  	++p;
  	cvs_output ("\t", 1);
  	while (1)
  	{
! 	    while (*p != ',' && *p != '\0')
  		cvs_output (p++, 1);
  	    if (*p == '\0')
  	    {
  		cvs_output ("\n", 1);
  		goto out;
  	    }
  	    if (*p == ',')
  	    {
  		++p;
  		break;
  	    }
  	    ++p;
  	    cvs_output ("\t", 1);
  	}
  	cvs_output ("\n", 1);
      }
Index: src/server.c
===================================================================
RCS file: /home/nyap/.cvsroot/cvs/src/server.c,v
retrieving revision 1.1.1.1
retrieving revision 1.1.1.1.8.1
diff -C16 -w -r1.1.1.1 -r1.1.1.1.8.1
*** src/server.c	2001/03/06 16:21:21	1.1.1.1
--- src/server.c	2001/03/08 13:22:04	1.1.1.1.8.1
***************
*** 1990,2038 ****
  		else
  		{
  		    sprintf (pending_error_text,
  			     "E error reading notification for %s", arg);
  		    pending_error = status;
  		}
  	    }
  	}
  	free (new->filename);
  	free (new->dir);
  	free (new);
      }
      else
      {
  	char *cp;
  
! 	if (strchr (data, '+'))
  	    goto error;
  
  	new->type = data;
  	if (data[1] != '\t')
  	    goto error;
  	data[1] = '\0';
  	cp = data + 2;
  	new->val = cp;
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
! 	*cp++ = '+';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
! 	*cp++ = '+';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
  	*cp++ = '\0';
  	new->watches = cp;
  	/* If there is another tab, ignore everything after it,
  	   for future expansion.  */
  	cp = strchr (cp, '\t');
  	if (cp != NULL)
  	{
  	    *cp = '\0';
  	}
  
  	new->next = NULL;
  
  	if (last_node == NULL)
--- 1990,2038 ----
  		else
  		{
  		    sprintf (pending_error_text,
  			     "E error reading notification for %s", arg);
  		    pending_error = status;
  		}
  	    }
  	}
  	free (new->filename);
  	free (new->dir);
  	free (new);
      }
      else
      {
  	char *cp;
  
! 	if (strchr (data, '&'))
  	    goto error;
  
  	new->type = data;
  	if (data[1] != '\t')
  	    goto error;
  	data[1] = '\0';
  	cp = data + 2;
  	new->val = cp;
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
! 	*cp++ = '&';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
! 	*cp++ = '&';
  	cp = strchr (cp, '\t');
  	if (cp == NULL)
  	    goto error;
  	*cp++ = '\0';
  	new->watches = cp;
  	/* If there is another tab, ignore everything after it,
  	   for future expansion.  */
  	cp = strchr (cp, '\t');
  	if (cp != NULL)
  	{
  	    *cp = '\0';
  	}
  
  	new->next = NULL;
  
  	if (last_node == NULL)
