File minicom-2.4-norootsetup.diff of Package minicom
save to ~/.minirc if not root
Index: minicom-2.6.2/src/config.c
===================================================================
--- minicom-2.6.2.orig/src/config.c
+++ minicom-2.6.2/src/config.c
@@ -1298,7 +1298,7 @@ void vdodflsave(void)
int dodflsave(void)
{
FILE *fp;
- char *fname = dosetup ? parfile : pparfile;
+ char *fname = getuid() == 0 ? parfile : pparfile;
if ((fp = fopen(fname, "w")) == NULL) {
werror(_("Cannot write to %s"), fname);
@@ -1353,6 +1353,7 @@ static void donamsave(void)
s = input(_("Give name to save this configuration?"), ifile);
if (s != (char *)0 && *s != 0) {
snprintf(parfile, sizeof(parfile), "%s/minirc.%s", CONFDIR, s);
+ snprintf(pparfile, sizeof(pparfile), "%s/.minirc.%s", homedir, s);
dodflsave();
}
}