Lines 252-267
Link Here
|
252 |
firstDay = FirstDay(month, year); |
252 |
firstDay = FirstDay(month, year); |
253 |
|
253 |
|
254 |
if (calendarDir == NULL) { |
254 |
if (calendarDir == NULL) { |
|
|
255 |
homedir = getenv("HOME"); |
255 |
if (appResources.calendarDir == NULL) { |
256 |
if (appResources.calendarDir == NULL) { |
256 |
/* open the ~/Calendar directory - create if necessary */ |
257 |
/* open the ~/Calendar directory - create if necessary */ |
257 |
homedir = getenv("HOME"); |
|
|
258 |
|
258 |
|
259 |
calendarDir = XtMalloc(strlen(homedir) + 10); |
259 |
calendarDir = XtMalloc(strlen(homedir) + 10); |
260 |
strcpy(calendarDir, homedir); |
260 |
strcpy(calendarDir, homedir); |
261 |
strcat(strcat(calendarDir, "/"), "Calendar"); |
261 |
strcat(strcat(calendarDir, "/"), "Calendar"); |
262 |
} else { |
262 |
} else { |
263 |
calendarDir = XtMalloc(strlen(appResources.calendarDir) + 3); |
263 |
/* check fo absolute path */ |
264 |
strcpy(calendarDir, appResources.calendarDir); |
264 |
if (appResources.calendarDir[0] == '/') |
|
|
265 |
{ |
266 |
/* calendarDir is an absolute /xxxxx path */ |
267 |
calendarDir = XtMalloc(strlen(appResources.calendarDir) + 3); |
268 |
strcpy(calendarDir, appResources.calendarDir); |
269 |
} else { |
270 |
/* not absolute -> prefix homedir */ |
271 |
calendarDir = XtMalloc(strlen(homedir) + |
272 |
strlen(appResources.calendarDir) + 3); |
273 |
strcpy(calendarDir, homedir); |
274 |
strcat(strcat(calendarDir, "/"), appResources.calendarDir); |
275 |
} |
265 |
} |
276 |
} |
266 |
} |
277 |
} |
267 |
error_status = stat(calendarDir, &dir_status); |
278 |
error_status = stat(calendarDir, &dir_status); |