On Mon, Jul 29, 2019 at 8:15 PM Ted Unangst <[email protected]> wrote:
>
> Kalwe Caramalac wrote:
> > Hi, this is my first diff submission, forgive me if have any error,
> > if anyone has any tips on how to do this i appreciate it.
>
> > @@ -588,7 +585,6 @@ dopopd(Char **v, struct command *t)
> > void
> > dfree(struct directory *dp)
> > {
> > -
> > if (dp->di_count != 0) {
>
> It's very common style to leave a blank line in functions without local
> variables.
I did not now that, i will correct this
>
> Also, your mailer has mangled the diff.
If have any other error let me now .
diff --git a/bin/csh/alloc.c b/bin/csh/alloc.c
index 7720ddb9536..2053bf219fe 100644
--- a/bin/csh/alloc.c
+++ b/bin/csh/alloc.c
@@ -72,7 +72,6 @@ xcalloc(size_t s, size_t n)
child++;
stderror(ERR_NOMEM);
}
-
return (ptr);
}
@@ -80,7 +79,7 @@ char *
xstrdup(const char *s)
{
char *n;
-
+
if (s == NULL)
s = "";
if ((n = strdup(s)) == NULL) {
diff --git a/bin/csh/csh.c b/bin/csh/csh.c
index 98e665507d1..1ed11a499ac 100644
--- a/bin/csh/csh.c
+++ b/bin/csh/csh.c
@@ -1190,7 +1190,6 @@ readf(void *oreo, char *buf, int siz)
return read(DESC(oreo), buf, siz);
}
-
static int
writef(void *oreo, const char *buf, int siz)
{
@@ -1203,7 +1202,6 @@ seekf(void *oreo, fpos_t off, int whence)
return lseek(DESC(oreo), off, whence);
}
-
static int
closef(void *oreo)
{
@@ -1232,7 +1230,6 @@ vis_fputc(int ch, FILE *fp)
void
initdesc(void)
{
-
didfds = 0; /* 0, 1, 2 aren't set up */
(void) fcntl(SHIN = dcopy(0, FSHIN), F_SETFD, FD_CLOEXEC);
(void) fcntl(SHOUT = dcopy(1, FSHOUT), F_SETFD, FD_CLOEXEC);
@@ -1241,7 +1238,6 @@ initdesc(void)
closem();
}
-
void
xexit(int i)
{
diff --git a/bin/csh/csh.h b/bin/csh/csh.h
index aa88f3ad1f9..563829b4dcc 100644
--- a/bin/csh/csh.h
+++ b/bin/csh/csh.h
@@ -318,7 +318,6 @@ struct command {
int t_nice;
};
-
/*
* These are declared here because they want to be
* initialized in sh.init.c (to allow them to be made readonly)
diff --git a/bin/csh/dir.c b/bin/csh/dir.c
index d66fc677c8f..f22c757d93c 100644
--- a/bin/csh/dir.c
+++ b/bin/csh/dir.c
@@ -245,7 +245,6 @@ dtilde(void)
dset(dcwd->di_name);
}
-
/* dnormalize():
* If the name starts with . or .. then we might need to normalize
* it depending on the symbolic link flags
@@ -457,7 +456,6 @@ dfollow(Char *cp)
return (NULL);
}
-
/*
* dopushd - push new directory onto directory stack.
* with no arguments exchange top and second.
@@ -886,7 +884,6 @@ dcanon(Char *cp, Char *p)
return cp;
}
-
/*
* dnewcwd - make a new directory in the loop the current one
*/
diff --git a/bin/csh/dol.c b/bin/csh/dol.c
index 8d96579a2aa..d58506a7d74 100644
--- a/bin/csh/dol.c
+++ b/bin/csh/dol.c
@@ -87,7 +87,6 @@ static void unDredc(int);
static int Dredc(void);
static void Dtestq(int);
-
/*
* Fix up the $ expansions and quotations in the
* argument list to command t.
@@ -317,7 +316,6 @@ Dword(void)
return (0);
}
-
/*
* Get a character, performing $ substitution unless flag is 0.
* Any QUOTES character which is returned from a $ expansion is
@@ -857,7 +855,7 @@ heredoc(Char *term)
* Check for EOF or compare to terminator -- before expansion
*/
if (c < 0 || eq(lbuf, term)) {
- (void) write(STDIN_FILENO, short2str(obuf),
+ (void) write(STDIN_FILENO, short2str(obuf),
(size_t) (BUFSIZ - ocnt));
(void) lseek(STDIN_FILENO, (off_t) 0, SEEK_SET);
return;
diff --git a/bin/csh/error.c b/bin/csh/error.c
index 9aa4054761f..7c1df869c9c 100644
--- a/bin/csh/error.c
+++ b/bin/csh/error.c
@@ -330,7 +330,6 @@ stderror(int id, ...)
haderr = 1; /* Now to diagnostic output */
timflg = 0; /* This isn't otherwise reset */
-
if (!(flags & ERR_SILENT)) {
if (flags & ERR_NAME)
(void) fprintf(csherr, "%s: ", bname);
diff --git a/bin/csh/exec.c b/bin/csh/exec.c
index 73530dfae3d..0b9ef7df391 100644
--- a/bin/csh/exec.c
+++ b/bin/csh/exec.c
@@ -95,7 +95,6 @@ static int tellmewhat(struct wordent *, Char *, int len);
static int executable(Char *, Char *, bool);
static int iscommand(Char *);
-
void
/*ARGSUSED*/
doexec(Char **v, struct command *t)
diff --git a/bin/csh/glob.c b/bin/csh/glob.c
index d21cd7c5bbc..714fbd92a45 100644
--- a/bin/csh/glob.c
+++ b/bin/csh/glob.c
@@ -84,7 +84,6 @@ static void pword(void);
static void psave(int);
static void backeval(Char *, bool);
-
static Char *
globtilde(Char **nv, Char *s)
{
@@ -203,7 +202,6 @@ globbrace(Char *s, Char *p, Char ***bl)
return (len);
}
-
static void
expbrace(Char ***nvp, Char ***elp, int size)
{
@@ -260,7 +258,6 @@ expbrace(Char ***nvp, Char ***elp, int size)
continue;
free(bl);
}
-
}
if (elp != NULL)
*elp = el;
@@ -274,7 +271,6 @@ globexpand(Char **v)
Char **nv, **vl, **el;
int size = GLOBSPACE;
-
nv = vl = xreallocarray(NULL, size, sizeof(Char *));
*vl = NULL;
@@ -331,7 +327,6 @@ globexpand(Char **v)
static Char *
handleone(Char *str, Char **vl, int action)
{
-
Char *cp, **vlp = vl;
switch (action) {
diff --git a/bin/csh/lex.c b/bin/csh/lex.c
index 5d20e22eb04..c2b72ee9071 100644
--- a/bin/csh/lex.c
+++ b/bin/csh/lex.c
@@ -1075,7 +1075,6 @@ getsel(int *al, int *ar, int dol)
return (0);
}
return (1);
-
}
static struct wordent *
@@ -1244,7 +1243,6 @@ findev(Char *cp, bool anyarg)
return (0);
}
-
static void
setexclp(Char *cp)
{
diff --git a/bin/csh/misc.c b/bin/csh/misc.c
index d0964e03602..79e2c2ca2d1 100644
--- a/bin/csh/misc.c
+++ b/bin/csh/misc.c
@@ -61,7 +61,6 @@ blkend(Char **up)
return (up);
}
-
void
blkpr(FILE *fp, Char **av)
{
diff --git a/bin/csh/proc.c b/bin/csh/proc.c
index 44274cc2744..9889a303de0 100644
--- a/bin/csh/proc.c
+++ b/bin/csh/proc.c
@@ -238,7 +238,6 @@ pwait(void)
pjwait(pcurrjob);
}
-
/*
* pjwait - wait for a job to finish or become stopped
* It is assumed to be in the foreground state (PFOREGND)
@@ -1182,7 +1181,6 @@ pfind(Char *cp)
return (0);
}
-
/*
* pgetcurr - find most recent job that is not pp, preferably stopped
*/
@@ -1308,7 +1306,6 @@ pfork(struct command *t, int wanttty)
palloc(pid, t);
sigprocmask(SIG_SETMASK, &osigset, NULL);
}
-
return (pid);
}
diff --git a/bin/csh/set.c b/bin/csh/set.c
index c638d0d00d9..11463ef69db 100644
--- a/bin/csh/set.c
+++ b/bin/csh/set.c
@@ -49,7 +49,6 @@ static void unsetv1(struct varent *);
static void exportpath(Char **);
static void balance(struct varent *, int, int);
-
/*
* C Shell
*/
@@ -428,7 +427,6 @@ set1(Char *var, Char **vec, struct varent *head)
setq(var, vec, head);
}
-
void
setq(Char *name, Char **vec, struct varent *p)
{