aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/diff
diff options
context:
space:
mode:
authorPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
committerPetter Rodhelind <petter.rodhelind@gmail.com>2020-01-14 11:41:08 +0100
commit02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch)
treef053238978479e408a2b83571443e132f30586ab /src/cmd/diff
parentc0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff)
parent3d1382b98a502d0c34d5ba2c462396acc515016e (diff)
downloadplan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2
plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/diff')
-rw-r--r--src/cmd/diff/diffio.c4
-rw-r--r--src/cmd/diff/diffreg.c18
-rw-r--r--src/cmd/diff/main.c8
3 files changed, 15 insertions, 15 deletions
diff --git a/src/cmd/diff/diffio.c b/src/cmd/diff/diffio.c
index 93de4e37..75a725ff 100644
--- a/src/cmd/diff/diffio.c
+++ b/src/cmd/diff/diffio.c
@@ -54,7 +54,7 @@ readline(Biobuf *bp, char *buf)
/*
* hashing has the effect of
* arranging line in 7-bit bytes and then
- * summing 1-s complement in 16-bit hunks
+ * summing 1-s complement in 16-bit hunks
*/
static int
readhash(Biobuf *bp, char *buf)
@@ -346,7 +346,7 @@ flushchanges(void)
if(nchanges == 0)
return;
-
+
for(i=0; i<nchanges; ){
j = changeset(i);
a = changes[i].a-Lines;
diff --git a/src/cmd/diff/diffreg.c b/src/cmd/diff/diffreg.c
index bb3fd112..ed4d17b8 100644
--- a/src/cmd/diff/diffreg.c
+++ b/src/cmd/diff/diffreg.c
@@ -19,7 +19,7 @@
* on the hash (called value). In particular, this
* collects the equivalence classes in file1 together.
* Subroutine equiv replaces the value of each line in
-* file0 by the index of the first element of its
+* file0 by the index of the first element of its
* matching equivalence in (the reordered) file1.
* To save space equiv squeezes file1 into a single
* array member in which the equivalence classes
@@ -34,15 +34,15 @@
* of "k-candidates". At step i a k-candidate is a matched
* pair of lines x,y (x in file0 y in file1) such that
* there is a common subsequence of lenght k
-* between the first i lines of file0 and the first y
+* between the first i lines of file0 and the first y
* lines of file1, but there is no such subsequence for
* any smaller y. x is the earliest possible mate to y
* that occurs in such a subsequence.
*
* Whenever any of the members of the equivalence class of
-* lines in file1 matable to a line in file0 has serial number
-* less than the y of some k-candidate, that k-candidate
-* with the smallest such y is replaced. The new
+* lines in file1 matable to a line in file0 has serial number
+* less than the y of some k-candidate, that k-candidate
+* with the smallest such y is replaced. The new
* k-candidate is chained (via pred) to the current
* k-1 candidate so that the actual subsequence can
* be recovered. When a member has serial number greater
@@ -64,7 +64,7 @@
* The core requirements for problems larger than somewhat
* are (in words) 2*length(file0) + length(file1) +
* 3*(number of k-candidates installed), typically about
-* 6n words for files of length n.
+* 6n words for files of length n.
*/
/* TIDY THIS UP */
struct cand {
@@ -91,7 +91,7 @@ long *ixold; /*will be overlaid on klist*/
long *ixnew; /*will be overlaid on file[1]*/
/* END OF SOME TIDYING */
-static void
+static void
sort(struct line *a, int n) /*shellsort CACM #201*/
{
int m;
@@ -352,14 +352,14 @@ cmp(Biobuf* b1, Biobuf* b2)
break;
if(memcmp((void *)b1s, (void *)b2s, n) != 0){
return 1;
- }
+ }
nc += n;
b1s += n;
b2s += n;
}
if(b1e - b1s == b2e - b2s)
return 0;
- return 1;
+ return 1;
}
void
diff --git a/src/cmd/diff/main.c b/src/cmd/diff/main.c
index 408ad90f..2697cb88 100644
--- a/src/cmd/diff/main.c
+++ b/src/cmd/diff/main.c
@@ -22,7 +22,7 @@ rmtmpfiles(void)
}
}
-void
+void
done(int status)
{
rmtmpfiles();
@@ -72,7 +72,7 @@ mkpathname(char *pathname, char *path, char *name)
sprint(pathname, "%s/%s", path, name);
return 0;
}
-
+
static char *
mktmpfile(int input, Dir **sb)
{
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
int i;
Dir *fsb, *tsb;
extern int _p9usepwlibrary;
-
+
_p9usepwlibrary = 0;
Binit(&stdout, 1, OWRITE);
progname = *argv;
@@ -214,7 +214,7 @@ main(int argc, char *argv[])
break;
case 'm':
- mflag = 1;
+ mflag = 1;
break;
case 'h':