[hackers] [sbase][PATCH] Remove unused parameters from libutil/concat and update all calls thereof.
diff --git a/cat.c b/cat.c
index e3741aa..bccd261 100644
--- a/cat.c
+++ b/cat.c
_AT_@ -7,7 +7,7 @@
#include "util.h"
static void
-uconcat(FILE *fp1, const char *s1, FILE *fp2, const char *s2)
+uconcat(FILE *fp1, FILE *fp2)
{
int c;
_AT_@ -27,7 +27,7 @@ main(int argc, char *argv[])
{
FILE *fp;
int ret = 0;
- void (*cat)(FILE *, const char *, FILE *, const char *) = &concat;
+ void (*cat)(FILE *, FILE *) = &concat;
ARGBEGIN {
case 'u':
_AT_@ -38,7 +38,7 @@ main(int argc, char *argv[])
} ARGEND
if (!argc) {
- cat(stdin, "<stdin>", stdout, "<stdout>");
+ cat(stdin, stdout);
} else {
for (; *argv; argc--, argv++) {
if (!strcmp(*argv, "-")) {
_AT_@ -49,7 +49,7 @@ main(int argc, char *argv[])
ret = 1;
continue;
}
- cat(fp, *argv, stdout, "<stdout>");
+ cat(fp, stdout);
if (fp != stdin && fshut(fp, *argv))
ret = 1;
}
diff --git a/libutil/concat.c b/libutil/concat.c
index fad9471..c1b06e8 100644
--- a/libutil/concat.c
+++ b/libutil/concat.c
_AT_@ -5,7 +5,7 @@
#include "../util.h"
void
-concat(FILE *fp1, const char *s1, FILE *fp2, const char *s2)
+concat(FILE *fp1, FILE *fp2)
{
char buf[BUFSIZ];
size_t n;
diff --git a/libutil/cp.c b/libutil/cp.c
index c398962..b7a6edc 100644
--- a/libutil/cp.c
+++ b/libutil/cp.c
_AT_@ -134,7 +134,7 @@ cp(const char *s1, const char *s2, int depth)
return 0;
}
}
- concat(f1, s1, f2, s2);
+ concat(f1, f2);
/* preserve permissions by default */
fchmod(fileno(f2), st.st_mode);
diff --git a/sponge.c b/sponge.c
index baeac7f..42fa1bb 100644
--- a/sponge.c
+++ b/sponge.c
_AT_@ -23,12 +23,12 @@ main(int argc, char *argv[])
if (!(tmpfp = tmpfile()))
eprintf("tmpfile:");
- concat(stdin, "<stdin>", tmpfp, "<tmpfile>");
+ concat(stdin, tmpfp);
rewind(tmpfp);
if (!(fp = fopen(argv[0], "w")))
eprintf("fopen %s:", argv[0]);
- concat(tmpfp, "<tmpfile>", fp, argv[0]);
+ concat(tmpfp, fp);
ret |= fshut(fp, argv[0]) | fshut(tmpfp, "<tmpfile>");
diff --git a/tail.c b/tail.c
index 711707f..94850f1 100644
--- a/tail.c
+++ b/tail.c
_AT_@ -30,7 +30,7 @@ dropinit(FILE *fp, const char *str, size_t n)
i++;
}
free(buf);
- concat(fp, str, stdout, "<stdout>");
+ concat(fp, stdout);
}
static void
diff --git a/text.h b/text.h
index bceda52..12fad9e 100644
--- a/text.h
+++ b/text.h
_AT_@ -13,5 +13,5 @@ struct linebuf {
#define EMPTY_LINEBUF {NULL, 0, 0,}
void getlines(FILE *, struct linebuf *);
-void concat(FILE *, const char *, FILE *, const char *);
+void concat(FILE *, FILE *);
int linecmp(struct line *, struct line *);
diff --git a/xinstall.c b/xinstall.c
index bf921fb..80dab27 100644
--- a/xinstall.c
+++ b/xinstall.c
_AT_@ -117,7 +117,7 @@ install(const char *s1, const char *s2, int depth)
else if (!(f2 = fopen(s2, "w")))
eprintf("fopen %s:", s2);
}
- concat(f1, s1, f2, s2);
+ concat(f1, f2);
fchmod(fileno(f2), mode);
Received on Sun Dec 25 2016 - 17:50:30 CET
This archive was generated by hypermail 2.3.0
: Sun Dec 25 2016 - 18:48:15 CET