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

Collapse All | Expand All

(-)ssh-add.c (+8 lines)
Lines 300-305 Link Here
300
	if (argc == 0) {
300
	if (argc == 0) {
301
		char buf[MAXPATHLEN];
301
		char buf[MAXPATHLEN];
302
		struct passwd *pw;
302
		struct passwd *pw;
303
		struct stat st;
304
		int count = 0;
303
305
304
		if ((pw = getpwuid(getuid())) == NULL) {
306
		if ((pw = getpwuid(getuid())) == NULL) {
305
			fprintf(stderr, "No user found with uid %u\n",
307
			fprintf(stderr, "No user found with uid %u\n",
Lines 311-319 Link Here
311
		for(i = 0; default_files[i]; i++) {
313
		for(i = 0; default_files[i]; i++) {
312
			snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, 
314
			snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, 
313
			    default_files[i]);
315
			    default_files[i]);
316
			if (stat(buf, &st) < 0)
317
				continue;
314
			if (do_file(ac, deleting, buf) == -1)
318
			if (do_file(ac, deleting, buf) == -1)
315
				ret = 1;
319
				ret = 1;
320
			else
321
				count++
316
		}
322
		}
323
		if (count == 0)
324
			ret = 1;
317
	} else {
325
	} else {
318
		for(i = 0; i < argc; i++) {
326
		for(i = 0; i < argc; i++) {
319
			if (do_file(ac, deleting, argv[i]) == -1)
327
			if (do_file(ac, deleting, argv[i]) == -1)

Return to bug 158