View | Details | Raw Unified | Return to bug 15227 | Differences between
and this patch

Collapse All | Expand All

(-)usr.bin/vacation/vacation.c (-3 / +9 lines)
Lines 117-118 Link Here
117
	int ch, iflag, lflag, mfail, ufail;
117
	int ch, iflag, lflag, mfail, ufail;
118
	char *dir = NULL;
118
119
Lines 120-122 Link Here
120
	interval = -1;
121
	interval = -1;
121
	while ((ch = getopt(argc, argv, "a:dIilr:")) != -1) {
122
	while ((ch = getopt(argc, argv, "a:dIilr:D:")) != -1) {
122
		switch((char)ch) {
123
		switch((char)ch) {
Lines 150-151 Link Here
150
			break;
151
			break;
152
		case 'D':
153
			dir = optarg;
154
			break;
151
		case '?':
155
		case '?':
Lines 183-187 Link Here
183
	}
187
	}
184
	if (chdir(pw->pw_dir)) {
188
	if (!dir)
189
		dir = pw->pw_dir;
190
	if (chdir(dir)) {
185
		msglog(LOG_NOTICE,
191
		msglog(LOG_NOTICE,
186
		    "vacation: no such directory %s.\n", pw->pw_dir);
192
		    "vacation: %s: %s.\n", dir, strerror(errno));
187
		exit(1);
193
		exit(1);

Return to bug 15227