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

Collapse All | Expand All

(-)ssh-add.c~ (+8 lines)
Lines 310-315 Link Here
310
	if (argc == 0) {
310
	if (argc == 0) {
311
		char buf[MAXPATHLEN];
311
		char buf[MAXPATHLEN];
312
		struct passwd *pw;
312
		struct passwd *pw;
313
		struct stat st;
314
		int count = 0;
313
315
314
		if ((pw = getpwuid(getuid())) == NULL) {
316
		if ((pw = getpwuid(getuid())) == NULL) {
315
			fprintf(stderr, "No user found with uid %u\n",
317
			fprintf(stderr, "No user found with uid %u\n",
Lines 321-329 Link Here
321
		for(i = 0; default_files[i]; i++) {
323
		for(i = 0; default_files[i]; i++) {
322
			snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, 
324
			snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, 
323
			    default_files[i]);
325
			    default_files[i]);
326
			if (stat(buf, &st) < 0)
327
				continue;
324
			if (do_file(ac, deleting, buf) == -1)
328
			if (do_file(ac, deleting, buf) == -1)
325
				ret = 1;
329
				ret = 1;
330
			else
331
				count++;
326
		}
332
		}
333
		if (count == 0)
334
			ret = 1;
327
	} else {
335
	} else {
328
		for(i = 0; i < argc; i++) {
336
		for(i = 0; i < argc; i++) {
329
			if (do_file(ac, deleting, argv[i]) == -1)
337
			if (do_file(ac, deleting, argv[i]) == -1)

Return to bug 158