BSD 3 development
[unix-history] / usr / src / cmd / who.c
index 194fe96..27e0b1d 100644 (file)
@@ -9,7 +9,7 @@ struct utmp utmp;
 struct passwd *pw;
 struct passwd *getpwuid();
 
 struct passwd *pw;
 struct passwd *getpwuid();
 
-char *ttyname(), *rindex(), *ctime(), *strcpy(), *index();
+char *ttyname(), *rindex(), *ctime(), *strcpy();
 main(argc, argv)
 char **argv;
 {
 main(argc, argv)
 char **argv;
 {
@@ -22,7 +22,7 @@ char **argv;
        if (argc==3) {
                tp = ttyname(0);
                if (tp)
        if (argc==3) {
                tp = ttyname(0);
                if (tp)
-                       tp = index(tp+1, '/') + 1;
+                       tp = rindex(tp, '/') + 1;
                else {  /* no tty - use best guess from passwd file */
                        pw = getpwuid(getuid());
                        strcpy(utmp.ut_name, pw?pw->pw_name: "?");
                else {  /* no tty - use best guess from passwd file */
                        pw = getpwuid(getuid());
                        strcpy(utmp.ut_name, pw?pw->pw_name: "?");
@@ -40,8 +40,8 @@ char **argv;
                if(argc==3) {
                        if (strcmp(utmp.ut_line, tp))
                                continue;
                if(argc==3) {
                        if (strcmp(utmp.ut_line, tp))
                                continue;
-#ifdef interdata
-                       printf("(Interdata) ");
+#ifdef vax
+                       printf("(Vax) ");
 #endif
                        putline();
                        exit(0);
 #endif
                        putline();
                        exit(0);