Remove a double free() that caused joins to randomly segfault.
Fix a bug in delete() that occasionally caused lines to be
transposed.
---
ed.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ed.c b/ed.c
index e737d57..f6e195f 100644
--- a/ed.c
+++ b/ed.c
@@ -781,7 +781,7 @@ d
Rather than printing byte sequences for any non-ASCII characters,
printable (via isprintrune()) Unicode characters are displayed
normally. The usual \$, \t, \b and \\ escapes are displayed, but
other non-printing characters are replaced with a Unicode escape
(\u).
This may be controversial, as
This fixes a segfault caused by running ed with a
nonexistant filename argument, e.g. 'ed not_a_file_yet'.
---
ed.c | 39 ++-
1 file changed, 22 insertions(+), 17 deletions(-)
diff --git a/ed.c b/ed.c
index 8903957..599e575 100644
--- a/ed.c
+++ b/ed.c
@@ -609,
getline(3) expects newline-terminated input. While glibc's
implementation seems to catch unterminated input and zero the
buffer, other versions (notably musl's) do not.
This is a workaround. Garbage will still be read, but
not printed.
---
tail.c | 5 +++--
1 file changed, 3 insertions(+), 2 dele
Previously, a line read from file 1 before a strcmp was
performed would be overwritten and lost. Something like
this:
comm one_line_file empty_file
produced no output.
This patch is a bit inelegant, but quite simple.
---
comm.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
---
join.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/join.c b/join.c
index 1f2fb8c..ddccdf1 100644
--- a/join.c
+++ b/join.c
@@ -173,10 +173,7 @@ linecmp(struct line *la, struct line *lb, size_t jfa,
size_t jfb)
} else {
status = memcmp(la->fi
The '%lud' format used in dprint caused 'd' to appear at the end
of each line number or character range. Using %ld seems to fix this.
---
sam/io.c | 2 +-
sam/sam.c | 8
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/sam/io.c b/sam/io.c
index 8740c7c..a554b11 100644
--- a
This fixes naive parsing that would happily read a giant string
of numbers into fileno provided the first character was correct.
---
join.c | 17 ++---
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/join.c b/join.c
index a013946..1f2fb8c 100644
--- a/join.c
+++ b/join.c
emg,
Quoth Evan Gates on Thu, Jun 18 2015 14:47 -0700:
diff --git a/find.c b/find.c
index 186263b..0de1951 100644
--- a/find.c
+++ b/find.c
@@ -415,10 +415,9 @@ pri_ok(struct arg *arg)
reply = fgetc(stdin);
/* throw away rest of line */
- while ((c = fgetc(stdin)) != '\n'
Carlos,
Quoth Carlos Torres on Wed, Jun 17 2015 17:26 -0400:
you forgot to attach the patch :)
As I understand git send-email, patches are sent as replies to the
intro message and not as attachments. Since FRIGN commented on the
'missing' patch, it couldn't have been lost. I don't think anythi
Quoth Evan Gates on Mon, Jun 15 2015 13:51 -0700:
On Mon, Jun 15, 2015 at 12:27 PM, Wolfgang Corcoran-Mathe
wrote:
---
find.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/find.c b/find.c
index dedf5a1..a870a90 100644
--- a/find.c
+++ b/find.c
@@ -429,6 +429,7 @@ pri_ok(struct arg *arg
---
find.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/find.c b/find.c
index dedf5a1..a870a90 100644
--- a/find.c
+++ b/find.c
@@ -429,6 +429,7 @@ pri_ok(struct arg *arg)
/* insert filename everywhere user gave us {} */
for (brace = o->braces; *brace; brace++)
The original flush-stdin loop (with fgets()) hung until the user
entered some extraneous characters for it to kill.
emg's FIXME about nulls still applies.
---
find.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/find.c b/find.c
index a870a90..3871105 100644
--- a/find.
emg,
I noticed a few other things in get_ok_arg(), primarily that the fgets()
flushing loop was causing find to hang mysteriously. Patch 2/3 should
fix this, hopefully.
The isplus branch seems to work, based on limited testing. I've enjoyed
reading your code, btw.
--
WCM
---
find.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/find.c b/find.c
index 3871105..4ce150f 100644
--- a/find.c
+++ b/find.c
@@ -411,7 +411,7 @@ pri_ok(struct arg *arg)
char ***brace, c;
struct okarg *o = arg->extra.p;
- fprintf(stderr, "%s: %s ?",
This caused a segfault with semicolon-terminated -exec primaries.
---
find.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/find.c b/find.c
index dcefca5..dedf5a1 100644
--- a/find.c
+++ b/find.c
@@ -607,6 +607,7 @@ get_exec_arg(char *argv[], union extra *extra)
for (arg = arg
Previously, 'cksum *' exited early if * contained a directory or
other file causing an fread() error.
Exit status is set to indicate an error has occurred.
---
cksum.c | 9 ++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/cksum.c b/cksum.c
index 3355b4c..570ca81 100644
---
Patch redone with global ret. Thanks, FRIGN.
--
WCM
Previously, 'cksum *' would exit early if * contained any
directories or other files causing fread() errors.
Exit status is set to indicate an error has occurred.
---
cksum.c | 11 +++
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/cksum.c b/cksum.c
index 3355b4c..179ab05 1
I went too quickly with the last patch. This version sets the
exit status properly when a file causes a read error, then
continues to the next file.
Sorry for patch spam.
--
WCM
Previously, 'cksum *' would exit early if * contained a directory
or any other file causing a read error.
---
cksum.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cksum.c b/cksum.c
index 3355b4c..3b4f4f8 100644
--- a/cksum.c
+++ b/cksum.c
@@ -71,8 +71,10 @@ cksum(FILE
Quoth FRIGN on Sat, Jun 06 2015 22:40 +0200:
Next time, please provide the patch with git format-patch, then
authorship will be preserved.
Thanks, noted.
--
Wolfgang Corcoran-Mathe
structure.
Patch withdrawn! I'm sorry if it was a waste of time. I appreciate
your opinions on this.
--
Wolfgang Corcoran-Mathe
This was causing some mysterious output bugs.
--
Wolfgang Corcoran-Mathe
diff --git a/join.c b/join.c
index f682023..76f9ff5 100644
--- a/join.c
+++ b/join.c
@@ -141,7 +141,7 @@ prjoin(struct line *la, struct line *lb, size_t jfa, size_t
jfb)
for (i = 0; i < lb->
join: Store string length in the line struct
This gets rid of a barbarous strlen()/fwrite() construct.
--
Wolfgang Corcoran-Mathe
diff --git a/join.c b/join.c
index b2fd07e..f682023 100644
--- a/join.c
+++ b/join.c
@@ -29,6 +29,7 @@ struct field {
struct line {
char *text
25 matches
Mail list logo