--- /tmp/screen-4.0.2/fileio.c 2003-09-08 16:25:28.000000000 +0200 +++ fileio.c 2005-05-13 10:32:23.000000000 +0200 @@ -2,6 +2,8 @@ * Juergen Weigert (address@hidden) * Michael Schroeder (address@hidden) * Copyright (c) 1987 Oliver Laumann + * A part for the configuration file loading was written by + * Nico Golde * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -291,13 +293,23 @@ do_source(rcfilename) char *rcfilename; { + char * home = getenv("HOME"); + if (rc_recursion > 10) { Msg(0, "%s: source: recursion limit reached", rc_name); return; } rc_recursion++; - FinishRc(rcfilename); + if(!home) + FinishRc(rcfilename); + else{ + if (strncmp(rcfilename,"~/",2)==0) { + char * tmp_file = alloca(_POSIX_PATH_MAX+1); + snprintf(tmp_file,_POSIX_PATH_MAX+1,"%s/%s",home,rcfilename+2); + FinishRc(tmp_file); + } + } rc_recursion--; }