=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mg/fileio.c,v retrieving revision 1.92 retrieving revision 1.93 diff -u -r1.92 -r1.93 --- src/usr.bin/mg/fileio.c 2012/06/15 17:52:42 1.92 +++ src/usr.bin/mg/fileio.c 2012/06/18 07:14:55 1.93 @@ -1,4 +1,4 @@ -/* $OpenBSD: fileio.c,v 1.92 2012/06/15 17:52:42 lum Exp $ */ +/* $OpenBSD: fileio.c,v 1.93 2012/06/18 07:14:55 jasper Exp $ */ /* This file is in the public domain. */ @@ -21,13 +21,14 @@ #include #include "kbd.h" +#include "pathnames.h" static char *bkuplocation(const char *); static int bkupleavetmp(const char *); char *expandtilde(const char *); static char *bkupdir; -static int leavetmp = 0; /* 1 = leave any '~' files in tmp dir */ +static int leavetmp = 0; /* 1 = leave any '~' files in tmp dir */ /* * Open a file for reading. @@ -46,7 +47,7 @@ return (FIODIR); ffstat(*ffp, bp); - + return (FIOSUC); } @@ -136,7 +137,7 @@ { if (fclose(ffp) == 0) return (FIOSUC); - return (FIOERR); + return (FIOERR); } /* @@ -326,11 +327,11 @@ goto nohome; if (suffix == NULL) { - ret = snprintf(file, sizeof(file), "%s/.mg", home); + ret = snprintf(file, sizeof(file), _PATH_MG_STARTUP, home); if (ret < 0 || ret >= sizeof(file)) return (NULL); } else { - ret = snprintf(file, sizeof(file), "%s/.mg-%s", home, suffix); + ret = snprintf(file, sizeof(file), _PATH_MG_TERM, home, suffix); if (ret < 0 || ret >= sizeof(file)) return (NULL); } @@ -576,7 +577,7 @@ return (FALSE); return (TRUE); - + } /* @@ -628,7 +629,7 @@ int backuptohomedir(int f, int n) { - const char *c = "~/.mg.d"; + const char *c = _PATH_MG_DIR; char *p; if (bkupdir == NULL) { @@ -688,7 +689,7 @@ return (FALSE); } -/* +/* * Expand file names beginning with '~' if appropriate: * 1, if ./~fn exists, continue without expanding tilde. * 2, else, if username 'fn' exists, expand tilde with home directory path.