--- cvs-1.12.13+real.orig/src/patch.c
+++ cvs-1.12.13+real/src/patch.c
@@ -46,13 +46,13 @@
 
 static const char *const patch_usage[] =
 {
-    "Usage: %s %s [-flR] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n",
+    "Usage: %s %s [-flR] [-c|-u[p]] [-s|-t] [-V %%d] [-k kopt]\n",
     "    -r rev|-D date [-r rev2 | -D date2] modules...\n",
     "\t-f\tForce a head revision match if tag/date not found.\n",
     "\t-l\tLocal directory only, not recursive\n",
     "\t-R\tProcess directories recursively.\n",
     "\t-c\tContext diffs (default)\n",
-    "\t-u\tUnidiff format.\n",
+    "\t-u\tUnidiff format (-p works the same as in diff).\n",
     "\t-s\tShort patch - one liner per file.\n",
     "\t-t\tTop two diffs - last change made to the file.\n",
     "\t-V vers\tUse RCS Version \"vers\" for keyword expansion.\n",
@@ -78,7 +78,7 @@
 	usage (patch_usage);
 
     optind = 0;
-    while ((c = getopt (argc, argv, "+V:k:cuftsQqlRD:r:")) != -1)
+    while ((c = getopt (argc, argv, "+V:k:cupftsQqlRD:r:")) != -1)
     {
 	switch (c)
 	{
@@ -149,10 +149,13 @@
 		       "the -V option is obsolete and should not be used");
 		break;
 	    case 'u':
-		unidiff = 1;		/* Unidiff */
+		unidiff |= 1;		/* Unidiff */
 		break;
 	    case 'c':			/* Context diff */
-		unidiff = 0;
+		unidiff &= ~1;
+		break;
+	    case 'p':
+		unidiff |= 2;		/* Unidiff context */
 		break;
 	    case '?':
 	    default:
@@ -167,6 +170,8 @@
     if (argc < 1)
 	usage (patch_usage);
 
+    if (!(unidiff & 1))
+	unidiff = 0;
     if (toptwo_diffs && patch_short)
 	error (1, 0, "-t and -s options are mutually exclusive");
     if (toptwo_diffs && (date1 != NULL || date2 != NULL ||
@@ -202,6 +207,8 @@
 	    send_arg("-s");
 	if (unidiff)
 	    send_arg("-u");
+	if (unidiff & 2)
+	    send_arg("-p");
 
 	if (rev1)
 	    option_with_arg ("-r", rev1);
@@ -270,6 +277,7 @@
     int which;
     char *repository;
     char *where;
+    char *cp;
 
     TRACE ( TRACE_FUNCTION, "patch_proc ( %s, %s, %s, %d, %d, %s, %s )",
 	    xwhere ? xwhere : "(null)",
@@ -292,7 +300,6 @@
     /* if mfile isn't null, we need to set up to do only part of the module */
     if (mfile != NULL)
     {
-	char *cp;
 	char *path;
 
 	/* if the portion of the module is a path, put the dir part on repos */
@@ -342,14 +349,30 @@
 
     if (rev1 != NULL && !rev1_validated)
     {
-	tag_check_valid (rev1, argc - 1, argv + 1, local_specified, 0,
-			 repository, false);
+	if ((cp = strchr(rev1, ':')) != NULL)
+	{
+	    *cp++ = '\0';
+	    date1 = Make_Date (cp);
+	    if (*rev1 == '\0')
+		rev1 = NULL;
+	}
+	if (rev1)
+	    tag_check_valid (rev1, argc - 1, argv + 1, local_specified, 0,
+			     repository, false);
 	rev1_validated = 1;
     }
     if (rev2 != NULL && !rev2_validated)
     {
-	tag_check_valid (rev2, argc - 1, argv + 1, local_specified, 0,
-			 repository, false);
+	if ((cp = strchr(rev2, ':')) != NULL)
+	{
+	    *cp++ = '\0';
+	    date2 = Make_Date (cp);
+	    if (*rev2 == '\0')
+		rev2 = NULL;
+	}
+	if (rev2)
+	    tag_check_valid (rev2, argc - 1, argv + 1, local_specified, 0,
+			     repository, false);
 	rev2_validated = 1;
     }
 
@@ -571,6 +594,7 @@
 
     if (unidiff) run_add_arg_p (&dargc, &darg_allocated, &dargv, "-u");
     else run_add_arg_p (&dargc, &darg_allocated, &dargv, "-c");
+    if (unidiff & 2) run_add_arg_p (&dargc, &darg_allocated, &dargv, "-p");
     switch (diff_exec (tmpfile1, tmpfile2, NULL, NULL, dargc, dargv,
 		       tmpfile3))
     {
@@ -671,7 +695,10 @@
 	       program.  */
 	    if (unidiff)
 	    {
-		cvs_output ("diff -u ", 0);
+		if (unidiff & 2)
+		    cvs_output ("diff -up ", 0);
+		else
+		    cvs_output ("diff -u ", 0);
 		cvs_output (file1, 0);
 		cvs_output (" ", 1);
 		cvs_output (file2, 0);
