-/* $OpenBSD: dir.c,v 1.29 2016/09/12 18:32:54 millert Exp $ */
+/* $OpenBSD: dir.c,v 1.30 2017/05/30 07:05:22 florian Exp $ */
/* This file is in the public domain. */
{
struct stat sb;
int finished, ishere;
- mode_t dir_mode, mode, oumask;
+ mode_t dir_mode, f_mode, oumask;
char *slash;
if ((path = adjustname(path, TRUE)) == NULL)
slash = path;
oumask = umask(0);
- mode = 0777 & ~oumask;
- dir_mode = mode | S_IWUSR | S_IXUSR;
+ f_mode = 0777 & ~oumask;
+ dir_mode = f_mode | S_IWUSR | S_IXUSR;
for (;;) {
slash += strspn(slash, "/");
continue;
}
- if (mkdir(path, finished ? mode : dir_mode) == 0) {
- if (mode > 0777 && chmod(path, mode) < 0) {
+ if (mkdir(path, finished ? f_mode : dir_mode) == 0) {
+ if (f_mode > 0777 && chmod(path, f_mode) < 0) {
umask(oumask);
return (ABORT);
}
-/* $OpenBSD: fileio.c,v 1.103 2016/07/28 21:40:25 tedu Exp $ */
+/* $OpenBSD: fileio.c,v 1.104 2017/05/30 07:05:22 florian Exp $ */
/* This file is in the public domain. */
fbackupfile(const char *fn)
{
struct stat sb;
+ struct timespec new_times[2];
int from, to, serrno;
ssize_t nread;
char buf[BUFSIZ];
(void) fchmod(to, (sb.st_mode & 0777));
/* copy the mtime to the backupfile */
- struct timespec new_times[2];
new_times[0] = sb.st_atim;
new_times[1] = sb.st_mtim;
futimens(to, new_times);
-/* $OpenBSD: modes.c,v 1.20 2015/03/19 21:22:15 bcallah Exp $ */
+/* $OpenBSD: modes.c,v 1.21 2017/05/30 07:05:22 florian Exp $ */
/* This file is in the public domain. */
int defb_flag = 0;
int
-changemode(int f, int n, char *mode)
+changemode(int f, int n, char *newmode)
{
int i;
struct maps_s *m;
- if ((m = name_mode(mode)) == NULL) {
+ if ((m = name_mode(newmode)) == NULL) {
dobeep();
- ewprintf("Can't find mode %s", mode);
+ ewprintf("Can't find mode %s", newmode);
return (FALSE);
}
if (!(f & FFARG)) {
-/* $OpenBSD: re_search.c,v 1.31 2015/03/19 21:22:15 bcallah Exp $ */
+/* $OpenBSD: re_search.c,v 1.32 2017/05/30 07:05:22 florian Exp $ */
/* This file is in the public domain. */
* some do-it-yourself control expansion.
*/
static int
-re_readpattern(char *prompt)
+re_readpattern(char *re_prompt)
{
static int dofree = 0;
int flags, error, s;
char tpat[NPAT], *rep;
if (re_pat[0] == '\0')
- rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, prompt);
+ rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, re_prompt);
else
rep = eread("%s: (default %s) ", tpat, NPAT,
- EFNUL | EFNEW | EFCR, prompt, re_pat);
+ EFNUL | EFNEW | EFCR, re_prompt, re_pat);
if (rep == NULL)
return (ABORT);
if (rep[0] != '\0') {
-/* $OpenBSD: search.c,v 1.44 2015/03/19 21:22:15 bcallah Exp $ */
+/* $OpenBSD: search.c,v 1.45 2017/05/30 07:05:22 florian Exp $ */
/* This file is in the public domain. */
}
/*
- * Prompt writing routine for the incremental search. The "prompt" is just
+ * Prompt writing routine for the incremental search. The "i_prompt" is just
* a string. The "flag" determines whether pat should be printed.
*/
static void
-is_dspl(char *prompt, int flag)
+is_dspl(char *i_prompt, int flag)
{
if (flag != FALSE)
- ewprintf("%s: ", prompt);
+ ewprintf("%s: ", i_prompt);
else
- ewprintf("%s: %s", prompt, pat);
+ ewprintf("%s: %s", i_prompt, pat);
}
/*
* expansion.
*/
int
-readpattern(char *prompt)
+readpattern(char *r_prompt)
{
char tpat[NPAT], *rep;
int retval;
if (pat[0] == '\0')
- rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, prompt);
+ rep = eread("%s: ", tpat, NPAT, EFNEW | EFCR, r_prompt);
else
rep = eread("%s: (default %s) ", tpat, NPAT,
- EFNUL | EFNEW | EFCR, prompt, pat);
+ EFNUL | EFNEW | EFCR, r_prompt, pat);
/* specified */
if (rep == NULL) {
-/* $OpenBSD: tags.c,v 1.14 2016/09/01 10:01:53 sunil Exp $ */
+/* $OpenBSD: tags.c,v 1.15 2017/05/30 07:05:22 florian Exp $ */
/*
* This file is in the public domain.
* Search through each line of buffer for pattern.
*/
int
-searchpat(char *pat)
+searchpat(char *s_pat)
{
struct line *lp;
int dotline;
size_t plen;
- plen = strlen(pat);
+ plen = strlen(s_pat);
dotline = 1;
lp = lforw(curbp->b_headp);
while (lp != curbp->b_headp) {
if (ltext(lp) != NULL && plen <= llength(lp) &&
- (strncmp(pat, ltext(lp), plen) == 0)) {
+ (strncmp(s_pat, ltext(lp), plen) == 0)) {
curwp->w_doto = 0;
curwp->w_dotp = lp;
curwp->w_dotline = dotline;