--- xcalendar-vanilla/dayeditor.c 1995-09-30 21:54:55.000000000 -0700 +++ xcalendar/dayeditor.c 2004-04-20 00:01:25.000586944 -0700 @@ -252,16 +252,27 @@ firstDay = FirstDay(month, year); if (calendarDir == NULL) { + homedir = getenv("HOME"); if (appResources.calendarDir == NULL) { /* open the ~/Calendar directory - create if necessary */ - homedir = getenv("HOME"); calendarDir = XtMalloc(strlen(homedir) + 10); strcpy(calendarDir, homedir); strcat(strcat(calendarDir, "/"), "Calendar"); } else { - calendarDir = XtMalloc(strlen(appResources.calendarDir) + 3); - strcpy(calendarDir, appResources.calendarDir); + /* check fo absolute path */ + if (appResources.calendarDir[0] == '/') + { + /* calendarDir is an absolute /xxxxx path */ + calendarDir = XtMalloc(strlen(appResources.calendarDir) + 3); + strcpy(calendarDir, appResources.calendarDir); + } else { + /* not absolute -> prefix homedir */ + calendarDir = XtMalloc(strlen(homedir) + + strlen(appResources.calendarDir) + 3); + strcpy(calendarDir, homedir); + strcat(strcat(calendarDir, "/"), appResources.calendarDir); + } } } error_status = stat(calendarDir, &dir_status);