home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / FILE / PATCH12.ZIP / MYPATCH.DIF < prev    next >
Encoding:
Text File  |  1990-06-02  |  23.1 KB  |  787 lines

  1. *** ../tcpatch/common.h    Thu May 31 12:34:31 1990
  2. --- common.h    Thu May 31 12:47:03 1990
  3. **************
  4. *** 128,137
  5.   EXT char *origext INIT(Nullch);
  6.   EXT char *origprae INIT(Nullch);
  7.   
  8. ! EXT char TMPOUTNAME[] INIT("/tmp/patchoXXXXXX");
  9. ! EXT char TMPINNAME[] INIT("/tmp/patchiXXXXXX");    /* might want /usr/tmp here */
  10. ! EXT char TMPREJNAME[] INIT("/tmp/patchrXXXXXX");
  11. ! EXT char TMPPATNAME[] INIT("/tmp/patchpXXXXXX");
  12.   EXT bool toutkeep INIT(FALSE);
  13.   EXT bool trejkeep INIT(FALSE);
  14.   
  15. --- 128,137 -----
  16.   EXT char *origext INIT(Nullch);
  17.   EXT char *origprae INIT(Nullch);
  18.   
  19. ! EXT char *TMPOUTNAME INIT("/tmp/patchoXXXXXX");
  20. ! EXT char *TMPINNAME  INIT("/tmp/patchiXXXXXX");    /* might want /usr/tmp here */
  21. ! EXT char *TMPREJNAME INIT("/tmp/patchrXXXXXX");
  22. ! EXT char *TMPPATNAME INIT("/tmp/patchpXXXXXX");
  23.   EXT bool toutkeep INIT(FALSE);
  24.   EXT bool trejkeep INIT(FALSE);
  25.   
  26. *** ../tcpatch/tcpatch.c    Thu May 31 12:34:31 1990
  27. --- patch.c    Thu May 31 12:47:03 1990
  28. ***************
  29. *** 1,5 ****
  30.   char rcsid[] =
  31. !     "$Header: patch.c,v 2.0.1.6 88/06/22 20:46:39 lwall Locked $";
  32.   
  33.   /* patch - a program to apply diffs to original files
  34.    *
  35. --- 1,5 ----
  36.   char rcsid[] =
  37. !     "$Header: patch.c,v 2.0.1.7 90/05/30 11:30:00 mward $";
  38.   
  39.   /* patch - a program to apply diffs to original files
  40.    *
  41. ***************
  42. *** 9,14 ****
  43. --- 9,18 ----
  44.    * money off of it, or pretend that you wrote it.
  45.    *
  46.    * $Log:    patch.c,v $
  47. +  * Revision 2.0.1.7  90/05/30  11:30:00  mward
  48. +  * Added usage message vars and routines: use_msg, progname, usage, fname
  49. +  * Check environment for TMP and init temp file names
  50. +  * 
  51.    * Revision 2.0.1.6  88/06/22  20:46:39  lwall
  52.    * patch12: rindex() wasn't declared
  53.    * 
  54. ***************
  55. *** 97,102 ****
  56. --- 101,108 ----
  57.   
  58.   /* procedures */
  59.   
  60. + char *fname();
  61. + void usage();
  62.   void reinitialize_almost_everything();
  63.   void get_some_switches();
  64.   LINENUM locate_hunk();
  65. ***************
  66. *** 112,117 ****
  67. --- 118,195 ----
  68.   void re_input();
  69.   void my_exit();
  70.   
  71. + char *progname;
  72. + char *use_msg[] = {
  73. +     "purpose: apply diff file(s) to original(s) to generate updated file(s)\n",
  74. +     "usage:   %s [options] orig patchfile [+ [options] orig]\n",
  75. +     "         %s <patchfile\n"
  76. +     "options:\n",
  77. +     "   -         read patchfile from standard input\n",
  78. +     "   -?        display help message (this text)\n",
  79. +     "   -b arg    use arg as backup file extension (default is ~ or .orig)\n",
  80. +     "   -B arg    use arg as backup file prefix (cancels -b option)\n",
  81. +     "   -c        interpret patchfile as context diffs\n",
  82. +     "   -d arg    use arg as directory to cd to before continuing\n",
  83. +     "   -D arg    surround patched with \"#ifdef arg ... #endif\"\n",
  84. +     "   -e        interpret patchfile as an ed script\n",
  85. +     "   -f        do not ask questions\n",
  86. +     "   -F<num>   set max fuzz factor to <num> (default 2, context diffs only)\n",
  87. +     "   -h        display help message (this text)\n",
  88. +     "   -l        loose (non \\n whitespace) pattern matching\n",
  89. +     "   -n        interpret patchfile as a normal diff\n",
  90. +     "   -N        ignore patches that are reversed or already applied\n",
  91. +     "   -o arg    use arg as output file name\n",
  92. +     "   -p<num>   set path strip count to <num> (default 937,# /'s to strip)\n",
  93. +     "   -r arg    use arg as the reject file name\n",
  94. +     "   -R        interpret patch as if orig and new were reversed at diff gen\n",
  95. +     "   -s        silent operation - no messages\n",
  96. +     "   -S        skip current patch, but continue\n",
  97. +     "   -v        version - print revision header and patch level\n",
  98. +     "   -x<num>   set internal debugging flags to <num>\n",
  99. +     "examples\n",
  100. +     "   %s <ms_sh_16.dif         # normally read all patches from stdin\n",
  101. +     "   %s -S + -S + <patch.dif  # skip 1st and 3rd patches in patch.dif\n",
  102. +     "notes:\n"
  103. +     "   By default, the patched version is put in place of the original\n",
  104. +     NULL
  105. + };
  106. + /* Return pointer to first char of file name in spec */
  107. + char *
  108. + fname(char *spec)
  109. + {
  110. +     char *cptr;
  111. +     char *tptr;
  112. +     cptr = spec + strlen(spec);
  113. +     while ((cptr!=spec) && (index("/\\:",*(cptr-1))==Nullch)) {
  114. +         cptr--;
  115. +     }
  116. +     if ((tptr=index(cptr,'.'))!=Nullch) *tptr='\0';
  117. +     strlwr(cptr);
  118. +     return (cptr);
  119. + }
  120. + /* Print the usage message */
  121. + void
  122. + usage()
  123. + {
  124. +     char **ptr;
  125. +     char *name;
  126. +     name = fname(progname);
  127. +     for (ptr=use_msg; *ptr; ptr++) {
  128. +         say2(*ptr,name);
  129. +     }
  130. + }
  131.   /* Apply a set of diffs as appropriate. */
  132.   
  133.   main(argc,argv)
  134. ***************
  135. *** 126,135 ****
  136. --- 204,226 ----
  137.       int failed = 0;
  138.       int failtotal = 0;
  139.       int i;
  140. +     char tmpdir[MAXPATH];
  141. +     char *tmpenv;
  142.   
  143. +     progname = (*argv[0]?argv[0]:"patch");
  144.       setbuf(stderr, serrbuf);
  145.       for (i = 0; i<MAXFILEC; i++)
  146.       filearg[i] = Nullch;
  147. +     /* initialize temp file names */
  148. +     tmpenv = getenv("TMP");
  149. +     strcpy(tmpdir,(tmpenv!=NULL?tmpenv:""));
  150. +     if (strlen(tmpdir) && tmpdir[strlen(tmpdir)-1]!='/') strcat(tmpdir,"/");
  151. +     TMPOUTNAME = strcat(strcpy(malloc(MAXPATH),tmpdir),fname(TMPOUTNAME));
  152. +     TMPINNAME  = strcat(strcpy(malloc(MAXPATH),tmpdir),fname(TMPINNAME));
  153. +     TMPREJNAME = strcat(strcpy(malloc(MAXPATH),tmpdir),fname(TMPREJNAME));
  154. +     TMPPATNAME = strcat(strcpy(malloc(MAXPATH),tmpdir),fname(TMPPATNAME));
  155.       Mktemp(TMPOUTNAME);
  156.       Mktemp(TMPINNAME);
  157.       Mktemp(TMPREJNAME);
  158. ***************
  159. *** 426,431 ****
  160. --- 517,527 ----
  161.               s++;
  162.           maxfuzz = atoi(s);
  163.           break;
  164. +         case '?':
  165. +         case 'h':
  166. +         usage();
  167. +         my_exit(0);
  168. +         break;
  169.           case 'l':
  170.           canonicalize = TRUE;
  171.           break;
  172. ***************
  173. *** 466,472 ****
  174.           break;
  175.   #endif
  176.           default:
  177. !         fatal2("Unrecognized switch: %s\n", Argv[0]);
  178.           }
  179.       }
  180.       }
  181. --- 562,570 ----
  182.           break;
  183.   #endif
  184.           default:
  185. !         say2("Unrecognized switch: %s\n", Argv[0]);
  186. !         usage();
  187. !         my_exit(1);
  188.           }
  189.       }
  190.       }
  191. *** ../patch/patch.man    Wed May 30 15:02:54 1990
  192. --- patch.man    Sat Jun 02 07:31:00 1990
  193. ***************
  194. *** 1,72 ****
  195. ! .rn '' }`
  196. ! ''' $Header: patch.man,v 2.0.1.2 88/06/22 20:47:18 lwall Locked $
  197. ! ''' 
  198. ! ''' $Log:    patch.man,v $
  199. ! ''' Revision 2.0.1.2  88/06/22  20:47:18  lwall
  200. ! ''' patch12: now avoids Bell System Logo
  201. ! ''' 
  202. ! ''' Revision 2.0.1.1  88/06/03  15:12:51  lwall
  203. ! ''' patch10: -B switch was contributed.
  204. ! ''' 
  205. ! ''' Revision 2.0  86/09/17  15:39:09  lwall
  206. ! ''' Baseline for netwide release.
  207. ! ''' 
  208. ! ''' Revision 1.4  86/08/01  19:23:22  lwall
  209. ! ''' Documented -v, -p, -F.
  210. ! ''' Added notes to patch senders.
  211. ! ''' 
  212. ! ''' Revision 1.3  85/03/26  15:11:06  lwall
  213. ! ''' Frozen.
  214. ! ''' 
  215. ! ''' Revision 1.2.1.4  85/03/12  16:14:27  lwall
  216. ! ''' Documented -p.
  217. ! ''' 
  218. ! ''' Revision 1.2.1.3  85/03/12  16:09:41  lwall
  219. ! ''' Documented -D.
  220. ! ''' 
  221. ! ''' Revision 1.2.1.2  84/12/05  11:06:55  lwall
  222. ! ''' Added -l switch, and noted bistability bug.
  223. ! ''' 
  224. ! ''' Revision 1.2.1.1  84/12/04  17:23:39  lwall
  225. ! ''' Branch for sdcrdcf changes.
  226. ! ''' 
  227. ! ''' Revision 1.2  84/12/04  17:22:02  lwall
  228. ! ''' Baseline version.
  229. ! ''' 
  230. ! .de Sh
  231. ! .br
  232. ! .ne 5
  233. ! .PP
  234. ! \fB\\$1\fR
  235. ! .PP
  236. ! ..
  237. ! .de Sp
  238. ! .if t .sp .5v
  239. ! .if n .sp
  240. ! ..
  241. ! '''
  242. ! '''     Set up \*(-- to give an unbreakable dash;
  243. ! '''     string Tr holds user defined translation string.
  244. ! '''     Bell System Logo is used as a dummy character.
  245. ! '''
  246. ! .ie n \{\
  247. ! .tr \(*W-\*(Tr
  248. ! .ds -- \(*W-
  249. ! .if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
  250. ! .if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
  251. ! .ds L" ""
  252. ! .ds R" ""
  253. ! .ds L' '
  254. ! .ds R' '
  255. ! 'br\}
  256. ! .el\{\
  257. ! .ds -- \(em\|
  258. ! .tr \*(Tr
  259. ! .ds L" ``
  260. ! .ds R" ''
  261. ! .ds L' `
  262. ! .ds R' '
  263. ! 'br\}
  264.   .TH PATCH 1 LOCAL
  265.   .SH NAME
  266.   patch - a program for applying a diff file to an original
  267. --- 1,5 ----
  268. ! .sc ^
  269. ! .nj
  270.   .TH PATCH 1 LOCAL
  271.   .SH NAME
  272.   patch - a program for applying a diff file to an original
  273. ***************
  274. *** 87,93 ****
  275.   version.
  276.   By default, the patched version is put in place of the original, with
  277.   the original file backed up to the same name with the
  278. ! extension \*(L".orig\*(R" or \*(L"~\*(R" , or as specified by the
  279.   .B -b
  280.   switch.
  281.   You may also specify where you want the output to go with a
  282. --- 20,26 ----
  283.   version.
  284.   By default, the patched version is put in place of the original, with
  285.   the original file backed up to the same name with the
  286. ! extension ".orig" or "~", or as specified by the
  287.   .B -b
  288.   switch.
  289.   You may also specify where you want the output to go with a
  290. ***************
  291. *** 99,107 ****
  292.   .PP
  293.   Upon startup, patch will attempt to determine the type of the diff listing,
  294.   unless over-ruled by a
  295. ! .BR -c ,
  296. ! .BR -e ,
  297. ! or
  298.   .B -n
  299.   switch.
  300.   Context diffs and normal diffs are applied by the
  301. --- 32,41 ----
  302.   .PP
  303.   Upon startup, patch will attempt to determine the type of the diff listing,
  304.   unless over-ruled by a
  305. ! .B -c
  306. ! ,
  307. ! .B -e
  308. ! , or
  309.   .B -n
  310.   switch.
  311.   Context diffs and normal diffs are applied by the
  312. ***************
  313. *** 144,150 ****
  314.   .I patch
  315.   cannot find a place to install that hunk of the patch, it will put the
  316.   hunk out to a reject file, which normally is the name of the output file
  317. ! plus \*(L".rej\*(R" or \*(L"#\*(R" .
  318.   (Note that the rejected hunk will come out in context diff form whether the
  319.   input patch was a context diff or a normal diff.
  320.   If the input was a normal diff, many of the contexts will simply be null.)
  321. --- 78,84 ----
  322.   .I patch
  323.   cannot find a place to install that hunk of the patch, it will put the
  324.   hunk out to a reject file, which normally is the name of the output file
  325. ! plus ".rej" or "#" .
  326.   (Note that the rejected hunk will come out in context diff form whether the
  327.   input patch was a context diff or a normal diff.
  328.   If the input was a normal diff, many of the contexts will simply be null.)
  329. ***************
  330. *** 168,176 ****
  331.   will try to figure out from the leading garbage what the name of the file
  332.   to edit is.
  333.   In the header of a context diff, the filename is found from lines beginning
  334. ! with \*(L"***\*(R" or \*(L"---\*(R", with the shortest name of an existing
  335.   file winning.
  336. ! Only context diffs have lines like that, but if there is an \*(L"Index:\*(R"
  337.   line in the leading garbage,
  338.   .I patch
  339.   will try to use the filename from that line.
  340. --- 102,110 ----
  341.   will try to figure out from the leading garbage what the name of the file
  342.   to edit is.
  343.   In the header of a context diff, the filename is found from lines beginning
  344. ! with "***" or "---", with the shortest name of an existing
  345.   file winning.
  346. ! Only context diffs have lines like that, but if there is an "Index:"
  347.   line in the leading garbage,
  348.   .I patch
  349.   will try to use the filename from that line.
  350. ***************
  351. *** 183,189 ****
  352.   .I patch
  353.   will attempt to get or check out the file.)
  354.   .PP
  355. ! Additionally, if the leading garbage contains a \*(L"Prereq: \*(R" line,
  356.   .I patch
  357.   will take the first word from the prerequisites line (normally a version
  358.   number) and check the input file to see if that word can be found.
  359. --- 117,123 ----
  360.   .I patch
  361.   will attempt to get or check out the file.)
  362.   .PP
  363. ! Additionally, if the leading garbage contains a "Prereq: " line,
  364.   .I patch
  365.   will take the first word from the prerequisites line (normally a version
  366.   number) and check the input file to see if that word can be found.
  367. ***************
  368. *** 215,257 ****
  369.   .PP
  370.   .I Patch
  371.   recognizes the following switches:
  372. ! .TP 5
  373. ! .B \-b
  374.   causes the next argument to be interpreted as the backup extension, to be
  375. ! used in place of \*(L".orig\*(R" or \*(L"~\*(R".
  376. ! .TP 5
  377. ! .B \-B
  378.   causes the next argument to be interpreted as a prefix to the backup file
  379.   name. If this argument is specified any argument from -b will be ignored.
  380.   This argument is an extension to Larry Wall's patch v2.0.1.4, patchlevel 8,
  381.   made by M. Greim (greim@sbsvax.uucp).
  382. ! .TP 5
  383. ! .B \-c
  384.   forces
  385.   .I patch
  386.   to interpret the patch file as a context diff.
  387. ! .TP 5
  388. ! .B \-d
  389.   causes
  390.   .I patch
  391.   to interpret the next argument as a directory, and cd to it before doing
  392.   anything else.
  393. ! .TP 5
  394. ! .B \-D
  395.   causes
  396.   .I patch
  397.   to use the "#ifdef...#endif" construct to mark changes.
  398.   The argument following will be used as the differentiating symbol.
  399.   Note that, unlike the C compiler, there must be a space between the
  400. ! .B \-D
  401.   and the argument.
  402. ! .TP 5
  403. ! .B \-e
  404.   forces
  405.   .I patch
  406.   to interpret the patch file as an ed script.
  407. ! .TP 5
  408. ! .B \-f
  409.   forces
  410.   .I patch
  411.   to assume that the user knows exactly what he or she is doing, and to not
  412. --- 149,185 ----
  413.   .PP
  414.   .I Patch
  415.   recognizes the following switches:
  416. ! .IN 8
  417. ! .TP -b
  418.   causes the next argument to be interpreted as the backup extension, to be
  419. ! used in place of ".orig" or "~".
  420. ! .TP -B
  421.   causes the next argument to be interpreted as a prefix to the backup file
  422.   name. If this argument is specified any argument from -b will be ignored.
  423.   This argument is an extension to Larry Wall's patch v2.0.1.4, patchlevel 8,
  424.   made by M. Greim (greim@sbsvax.uucp).
  425. ! .TP -c
  426.   forces
  427.   .I patch
  428.   to interpret the patch file as a context diff.
  429. ! .TP -d
  430.   causes
  431.   .I patch
  432.   to interpret the next argument as a directory, and cd to it before doing
  433.   anything else.
  434. ! .TP -D
  435.   causes
  436.   .I patch
  437.   to use the "#ifdef...#endif" construct to mark changes.
  438.   The argument following will be used as the differentiating symbol.
  439.   Note that, unlike the C compiler, there must be a space between the
  440. ! .B -D
  441.   and the argument.
  442. ! .TP -e
  443.   forces
  444.   .I patch
  445.   to interpret the patch file as an ed script.
  446. ! .TP -f
  447.   forces
  448.   .I patch
  449.   to assume that the user knows exactly what he or she is doing, and to not
  450. ***************
  451. *** 258,267 ****
  452.   ask any questions.
  453.   It does not suppress commentary, however.
  454.   Use
  455. ! .B \-s
  456.   for that.
  457. ! .TP 5
  458. ! .B \-F<number>
  459.   sets the maximum fuzz factor.
  460.   This switch only applies to context diffs, and causes
  461.   .I patch
  462. --- 186,194 ----
  463.   ask any questions.
  464.   It does not suppress commentary, however.
  465.   Use
  466. ! .B -s
  467.   for that.
  468. ! .TP -F<number>
  469.   sets the maximum fuzz factor.
  470.   This switch only applies to context diffs, and causes
  471.   .I patch
  472. ***************
  473. *** 269,276 ****
  474.   Note that a larger fuzz factor increases the odds of a faulty patch.
  475.   The default fuzz factor is 2, and it may not be set to more than
  476.   the number of lines of context in the context diff, ordinarily 3.
  477. ! .TP 5
  478. ! .B \-l
  479.   causes the pattern matching to be done loosely, in case the tabs and
  480.   spaces have been munged in your input file.
  481.   Any sequence of whitespace in the pattern line will match any sequence
  482. --- 196,202 ----
  483.   Note that a larger fuzz factor increases the odds of a faulty patch.
  484.   The default fuzz factor is 2, and it may not be set to more than
  485.   the number of lines of context in the context diff, ordinarily 3.
  486. ! .TP -l
  487.   causes the pattern matching to be done loosely, in case the tabs and
  488.   spaces have been munged in your input file.
  489.   Any sequence of whitespace in the pattern line will match any sequence
  490. ***************
  491. *** 277,299 ****
  492.   in the input file.
  493.   Normal characters must still match exactly.
  494.   Each line of the context must still match a line in the input file.
  495. ! .TP 5
  496. ! .B \-n
  497.   forces
  498.   .I patch
  499.   to interpret the patch file as a normal diff.
  500. ! .TP 5
  501. ! .B \-N
  502.   causes
  503.   .I patch
  504.   to ignore patches that it thinks are reversed or already applied.
  505.   See also
  506. ! .B \-R .
  507. ! .TP 5
  508. ! .B \-o
  509.   causes the next argument to be interpreted as the output file name.
  510. ! .TP 5
  511. ! .B \-p<number>
  512.   sets the pathname strip count,
  513.   which controls how pathnames found in the patch file are treated, in case
  514.   the you keep your files in a different directory than the person who sent
  515. --- 203,221 ----
  516.   in the input file.
  517.   Normal characters must still match exactly.
  518.   Each line of the context must still match a line in the input file.
  519. ! .TP -n
  520.   forces
  521.   .I patch
  522.   to interpret the patch file as a normal diff.
  523. ! .TP -N
  524.   causes
  525.   .I patch
  526.   to ignore patches that it thinks are reversed or already applied.
  527.   See also
  528. ! .B -R .
  529. ! .TP -o
  530.   causes the next argument to be interpreted as the output file name.
  531. ! .TP -p<number>
  532.   sets the pathname strip count,
  533.   which controls how pathnames found in the patch file are treated, in case
  534.   the you keep your files in a different directory than the person who sent
  535. ***************
  536. *** 306,338 ****
  537.       /u/howard/src/blurfl/blurfl.c
  538.   .sp
  539.   setting
  540. ! .B \-p
  541.   or
  542. ! .B \-p0
  543.   gives the entire pathname unmodified,
  544. ! .B \-p1
  545.   gives
  546.   .sp
  547.       u/howard/src/blurfl/blurfl.c
  548.   .sp
  549.   without the leading slash,
  550. ! .B \-p4
  551.   gives
  552.   .sp
  553.       blurfl/blurfl.c
  554.   .sp
  555.   and not specifying
  556. ! .B \-p
  557.   at all just gives you "blurfl.c".
  558.   Whatever you end up with is looked for either in the current directory,
  559.   or the directory specified by the
  560. ! .B \-d
  561.   switch.
  562. ! .TP 5
  563. ! .B \-r
  564.   causes the next argument to be interpreted as the reject file name.
  565. ! .TP 5
  566. ! .B \-R
  567.   tells
  568.   .I patch
  569.   that this patch was created with the old and new files swapped.
  570. --- 228,258 ----
  571.       /u/howard/src/blurfl/blurfl.c
  572.   .sp
  573.   setting
  574. ! .B -p
  575.   or
  576. ! .B -p0
  577.   gives the entire pathname unmodified,
  578. ! .B -p1
  579.   gives
  580.   .sp
  581.       u/howard/src/blurfl/blurfl.c
  582.   .sp
  583.   without the leading slash,
  584. ! .B -p4
  585.   gives
  586.   .sp
  587.       blurfl/blurfl.c
  588.   .sp
  589.   and not specifying
  590. ! .B -p
  591.   at all just gives you "blurfl.c".
  592.   Whatever you end up with is looked for either in the current directory,
  593.   or the directory specified by the
  594. ! .B -d
  595.   switch.
  596. ! .TP -r
  597.   causes the next argument to be interpreted as the reject file name.
  598. ! .TP -R
  599.   tells
  600.   .I patch
  601.   that this patch was created with the old and new files swapped.
  602. ***************
  603. *** 342,348 ****
  604.   will attempt to swap each hunk around before applying it.
  605.   Rejects will come out in the swapped format.
  606.   The
  607. ! .B \-R
  608.   switch will not work with ed diff scripts because there is too little
  609.   information to reconstruct the reverse operation.
  610.   .Sp
  611. --- 262,268 ----
  612.   will attempt to swap each hunk around before applying it.
  613.   Rejects will come out in the swapped format.
  614.   The
  615. ! .B -R
  616.   switch will not work with ed diff scripts because there is too little
  617.   information to reconstruct the reverse operation.
  618.   .Sp
  619. ***************
  620. *** 350,356 ****
  621.   .I patch
  622.   will reverse the hunk to see if it can be applied that way.
  623.   If it can, you will be asked if you want to have the
  624. ! .B \-R
  625.   switch set.
  626.   If it can't, the patch will continue to be applied normally.
  627.   (Note: this method cannot detect a reversed patch if it is a normal diff
  628. --- 270,276 ----
  629.   .I patch
  630.   will reverse the hunk to see if it can be applied that way.
  631.   If it can, you will be asked if you want to have the
  632. ! .B -R
  633.   switch set.
  634.   If it can't, the patch will continue to be applied normally.
  635.   (Note: this method cannot detect a reversed patch if it is a normal diff
  636. ***************
  637. *** 360,372 ****
  638.   Luckily, most patches add or change lines rather than delete them, so most
  639.   reversed normal diffs will begin with a delete, which will fail, triggering
  640.   the heuristic.)
  641. ! .TP 5
  642. ! .B \-s
  643.   makes
  644.   .I patch
  645.   do its work silently, unless an error occurs.
  646. ! .TP 5
  647. ! .B \-S
  648.   causes
  649.   .I patch
  650.   to ignore this patch from the patch file, but continue on looking
  651. --- 280,290 ----
  652.   Luckily, most patches add or change lines rather than delete them, so most
  653.   reversed normal diffs will begin with a delete, which will fail, triggering
  654.   the heuristic.)
  655. ! .TP -s
  656.   makes
  657.   .I patch
  658.   do its work silently, unless an error occurs.
  659. ! .TP -S
  660.   causes
  661.   .I patch
  662.   to ignore this patch from the patch file, but continue on looking
  663. ***************
  664. *** 376,396 ****
  665.       patch -S + -S + <patchfile
  666.   .sp
  667.   will ignore the first and second of three patches.
  668. ! .TP 5
  669. ! .B \-v
  670.   causes
  671.   .I patch
  672.   to print out it's revision header and patch level.
  673. ! .TP 5
  674. ! .B \-x<number>
  675.   sets internal debugging flags, and is of interest only to
  676.   .I patch
  677.   patchers.
  678.   .SH AUTHOR
  679.   Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
  680.   .SH ENVIRONMENT
  681. ! No environment variables are used by
  682. ! .IR patch .
  683.   .SH FILES
  684.   /tmp/patch*
  685.   .SH SEE ALSO
  686. --- 294,319 ----
  687.       patch -S + -S + <patchfile
  688.   .sp
  689.   will ignore the first and second of three patches.
  690. ! .TP -v
  691.   causes
  692.   .I patch
  693.   to print out it's revision header and patch level.
  694. ! .TP -x<number>
  695.   sets internal debugging flags, and is of interest only to
  696.   .I patch
  697.   patchers.
  698. + .OD
  699.   .SH AUTHOR
  700.   Larry Wall <lwall@jpl-devvax.jpl.nasa.gov>
  701.   .SH ENVIRONMENT
  702. ! .IN 8
  703. ! .TP TMP
  704. ! The location for temporary files created by
  705. ! .I patch.
  706. ! This string specifies the directory where
  707. ! .I patch
  708. ! puts any tempoorary files, and can (but need not) contain a terminating slash.
  709. ! .OD
  710.   .SH FILES
  711.   /tmp/patch*
  712.   .SH SEE ALSO
  713. ***************
  714. *** 407,413 ****
  715.   context diff header, or with an Index: line.
  716.   If you are patching something in a subdirectory, be sure to tell the patch
  717.   user to specify a 
  718. ! .B \-p
  719.   switch as needed.
  720.   Third, you can create a file by sending out a diff that compares a
  721.   null file to the file you want to create.
  722. --- 330,336 ----
  723.   context diff header, or with an Index: line.
  724.   If you are patching something in a subdirectory, be sure to tell the patch
  725.   user to specify a 
  726. ! .B -p
  727.   switch as needed.
  728.   Third, you can create a file by sending out a diff that compares a
  729.   null file to the file you want to create.
  730. ***************
  731. *** 423,429 ****
  732.   .I patch
  733.   couldn't parse your patch file.
  734.   .PP
  735. ! The message \*(L"Hmm...\*(R" indicates that there is unprocessed text in
  736.   the patch file and that
  737.   .I patch
  738.   is attempting to intuit whether there is a patch in that text and, if so,
  739. --- 346,352 ----
  740.   .I patch
  741.   couldn't parse your patch file.
  742.   .PP
  743. ! The message "Hmm..." indicates that there is unprocessed text in
  744.   the patch file and that
  745.   .I patch
  746.   is attempting to intuit whether there is a patch in that text and, if so,
  747. ***************
  748. *** 436,443 ****
  749.   .SH CAVEATS
  750.   .I Patch
  751.   cannot tell if the line numbers are off in an ed script, and can only detect
  752. ! bad line numbers in a normal diff when it finds a \*(L"change\*(R" or
  753. ! a \*(L"delete\*(R" command.
  754.   A context diff using fuzz factor 3 may have the same problem.
  755.   Until a suitable interactive interface is added, you should probably do
  756.   a context diff in these cases to see if the changes made sense.
  757. --- 359,366 ----
  758.   .SH CAVEATS
  759.   .I Patch
  760.   cannot tell if the line numbers are off in an ed script, and can only detect
  761. ! bad line numbers in a normal diff when it finds a "change" or
  762. ! a "delete" command.
  763.   A context diff using fuzz factor 3 may have the same problem.
  764.   Until a suitable interactive interface is added, you should probably do
  765.   a context diff in these cases to see if the changes made sense.
  766. ***************
  767. *** 464,467 ****
  768.   .I patch
  769.   will think it is a reversed patch, and offer to un-apply the patch.
  770.   This could be construed as a feature.
  771. - .rn }` ''
  772. --- 387,389 ----
  773.