projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rearranged code in the file.
[mmh]
/
sbr
/
context_read.c
diff --git
a/sbr/context_read.c
b/sbr/context_read.c
index
1e1a84e
..
0995d4f
100644
(file)
--- a/
sbr/context_read.c
+++ b/
sbr/context_read.c
@@
-27,7
+27,7
@@
#include <pwd.h> /* structure for getpwuid() results */
void
#include <pwd.h> /* structure for getpwuid() results */
void
-context_read (void)
+context_read(void)
{
char buf[BUFSIZ]; /* path name buffer */
char *cp; /* miscellaneous pointer */
{
char buf[BUFSIZ]; /* path name buffer */
char *cp; /* miscellaneous pointer */
@@
-44,11
+44,12
@@
context_read (void)
return;
/*
return;
/*
- ** Find user's home directory. Try the HOME environment variable first,
+ ** Find user's home directory. Try the HOME environment variable first,
** the home directory field in the password file if that's not found.
*/
if ((mypath = getenv("HOME")) == (char *)0) {
** the home directory field in the password file if that's not found.
*/
if ((mypath = getenv("HOME")) == (char *)0) {
- if ((pw = getpwuid(getuid())) == (struct passwd *)0 || *pw->pw_dir == '\0')
+ if ((pw = getpwuid(getuid())) == (struct passwd *)0 ||
+ *pw->pw_dir == '\0')
adios(NULL, "cannot determine your home directory");
else
mypath = pw->pw_dir;
adios(NULL, "cannot determine your home directory");
else
mypath = pw->pw_dir;
@@
-79,8
+80,8
@@
context_read (void)
cp = mh_profile;
}
cp = mh_profile;
}
- readconfig (&m_defs, ib, cp, 0);
- fclose (ib);
+ readconfig(&m_defs, ib, cp, 0);
+ fclose(ib);
/*
** Find the user's nmh directory, which is specified by the "path"
/*
** Find the user's nmh directory, which is specified by the "path"
@@
-88,28
+89,30
@@
context_read (void)
** one rooted in the home directory.
*/
** one rooted in the home directory.
*/
- if ((cp = context_find ("path")) == (char *)0)
- adios(NULL, "Your %s file does not contain a path entry.", defpath);
+ if ((cp = context_find("path")) == (char *)0)
+ adios(NULL, "Your %s file does not contain a path entry.",
+ defpath);
if (*cp == '\0')
adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath);
if (*cp != '/')
if (*cp == '\0')
adios(NULL, "Your `%s' profile file does not contain a valid path entry.", defpath);
if (*cp != '/')
- (void)snprintf (nd = buf, sizeof(buf), "%s/%s", mypath, cp);
+ (void)snprintf(nd = buf, sizeof(buf), "%s/%s", mypath, cp);
else
nd = cp;
if (stat(nd, &st) == -1) {
if (errno != ENOENT)
else
nd = cp;
if (stat(nd, &st) == -1) {
if (errno != ENOENT)
- adios (nd, "error opening");
- cp = concat ("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL);
+ adios(nd, "error opening");
+ cp = concat("Your MH-directory \"", nd, "\" doesn't exist; Create it? ", NULL);
if (!getanswer(cp))
if (!getanswer(cp))
- adios (NULL, "unable to access MH-directory \"%s\"", nd);
- free (cp);
- if (!makedir (nd))
- adios (NULL, "unable to create %s", nd);
+ adios(NULL, "unable to access MH-directory \"%s\"",
+ nd);
+ free(cp);
+ if (!makedir(nd))
+ adios(NULL, "unable to create %s", nd);
} else if ((st.st_mode & S_IFDIR) == 0)
} else if ((st.st_mode & S_IFDIR) == 0)
- adios ((char *)0, "`%s' is not a directory", nd);
+ adios((char *)0, "`%s' is not a directory", nd);
/*
** Open and read user's context file. The name of the context
/*
** Open and read user's context file. The name of the context
@@
-117,7
+120,7
@@
context_read (void)
** environment variable.
*/
** environment variable.
*/
- if ((cp = getenv ("MHCONTEXT")) == (char *)0 || *cp == '\0')
+ if ((cp = getenv("MHCONTEXT")) == (char *)0 || *cp == '\0')
cp = context;
/*
cp = context;
/*
@@
-131,11
+134,11
@@
context_read (void)
return;
}
return;
}
- ctxpath = getcpy (m_maildir (cp));
+ ctxpath = getcpy(m_maildir(cp));
- if ((ib = lkfopen (ctxpath, "r"))) {
- readconfig ((struct node **) 0, ib, cp, 1);
- lkfclose (ib, ctxpath);
+ if ((ib = lkfopen(ctxpath, "r"))) {
+ readconfig((struct node **) 0, ib, cp, 1);
+ lkfclose(ib, ctxpath);
}
return;
}
return;