[BACK]Return to cu.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / cu

Diff for /src/usr.bin/cu/cu.c between version 1.16 and 1.17

version 1.16, 2014/03/26 13:00:50 version 1.17, 2014/03/31 09:09:19
Line 60 
Line 60 
 void            stream_error(struct bufferevent *, short, void *);  void            stream_error(struct bufferevent *, short, void *);
 void            line_read(struct bufferevent *, void *);  void            line_read(struct bufferevent *, void *);
 void            line_error(struct bufferevent *, short, void *);  void            line_error(struct bufferevent *, short, void *);
 void            try_remote(const char *, const char *);  void            try_remote(const char *, const char *, const char *);
   
 __dead void  __dead void
 usage(void)  usage(void)
Line 74 
Line 74 
 main(int argc, char **argv)  main(int argc, char **argv)
 {  {
         const char      *errstr;          const char      *errstr;
         char            *tmp, *s;          char            *tmp, *s, *host;
         int              opt, i;          int              opt, i;
   
         if (isatty(STDIN_FILENO) && tcgetattr(STDIN_FILENO, &saved_tio) != 0)          if (isatty(STDIN_FILENO) && tcgetattr(STDIN_FILENO, &saved_tio) != 0)
Line 113 
Line 113 
         if (argc != 0 && argc != 1)          if (argc != 0 && argc != 1)
                 usage();                  usage();
   
         s = getenv("REMOTE");          if (argc == 1)
         if (argc == 1) {                  host = argv[0];
           else
                   host = getenv("HOST");
           if (host != NULL && *host != '\0') {
                   s = getenv("REMOTE");
                 if (s != NULL && *s == '/')                  if (s != NULL && *s == '/')
                         try_remote(argv[0], s);                          try_remote(host, s, NULL);
                 else                  else
                         try_remote(argv[0], NULL);                          try_remote(host, NULL, s);
         } else if (s != NULL && *s != '/')          }
                 try_remote(s, NULL);  
   
         if (line_path == NULL)          if (line_path == NULL)
                 line_path = "/dev/cua00";                  line_path = "/dev/cua00";
Line 306 
Line 309 
 }  }
   
 void  void
 try_remote(const char *host, const char *path)  try_remote(const char *host, const char *path, const char *entry)
 {  {
         const char      *paths[] = { "/etc/remote", NULL, NULL };          const char      *paths[] = { "/etc/remote", NULL, NULL };
         char            *cp, *s;          char            *cp, *s;
Line 318 
Line 321 
                 paths[1] = "/etc/remote";                  paths[1] = "/etc/remote";
         }          }
   
           if (entry != NULL && cgetset(entry) != 0)
                   cu_errx(1, "cgetset failed");
         error = cgetent(&cp, (char**)paths, (char*)host);          error = cgetent(&cp, (char**)paths, (char*)host);
         if (error < 0) {          if (error < 0) {
                 switch (error) {                  switch (error) {

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17