Deleted Added
full compact
50c50
< __FBSDID("$FreeBSD: head/usr.bin/write/write.c 92922 2002-03-22 01:42:45Z imp $");
---
> __FBSDID("$FreeBSD: head/usr.bin/write/write.c 97454 2002-05-29 13:14:51Z tjr $");
88a89,93
> while (getopt(argc, argv, "") != -1)
> usage();
> argc -= optind;
> argv += optind;
>
111,112c116,117
< case 2:
< search_utmp(argv[1], tty, mytty, myuid);
---
> case 1:
> search_utmp(argv[0], tty, mytty, myuid);
115,120c120,125
< case 3:
< if (!strncmp(argv[2], _PATH_DEV, strlen(_PATH_DEV)))
< argv[2] += strlen(_PATH_DEV);
< if (utmp_chk(argv[1], argv[2]))
< errx(1, "%s is not logged in on %s", argv[1], argv[2]);
< if (term_chk(argv[2], &msgsok, &atime, 1))
---
> case 2:
> if (!strncmp(argv[1], _PATH_DEV, strlen(_PATH_DEV)))
> argv[1] += strlen(_PATH_DEV);
> if (utmp_chk(argv[0], argv[1]))
> errx(1, "%s is not logged in on %s", argv[0], argv[1]);
> if (term_chk(argv[1], &msgsok, &atime, 1))
123,124c128,129
< errx(1, "%s has messages disabled on %s", argv[1], argv[2]);
< do_write(argv[2], mytty, myuid);
---
> errx(1, "%s has messages disabled on %s", argv[0], argv[1]);
> do_write(argv[1], mytty, myuid);