summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-09-30 21:34:44 +1100
committerDamien Miller <djm@mindrot.org>2000-09-30 21:34:44 +1100
commitf5a81473a9b9fbe90353eb72c49fb9fd2529c54a (patch)
tree5b1294adfbf652ec0d950df7f7e531a1a15b1c42
parent51155a70e74443e085b016a8c3fbfbf71ae56c76 (diff)
- (djm) Irix strips "/dev/tty" from [uw]tmp entries (other systems only
strip "/dev/"). Fix loginrec.c based on patch from Alain St-Denis <Alain.St-Denis@ec.gc.ca>
-rw-r--r--loginrec.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/loginrec.c b/loginrec.c
index 22c2be1e5..09dea55b9 100644
--- a/loginrec.c
+++ b/loginrec.c
@@ -161,7 +161,7 @@
161#include "xmalloc.h" 161#include "xmalloc.h"
162#include "loginrec.h" 162#include "loginrec.h"
163 163
164RCSID("$Id: loginrec.c,v 1.25 2000/09/23 03:12:25 djm Exp $"); 164RCSID("$Id: loginrec.c,v 1.26 2000/09/30 10:34:44 djm Exp $");
165 165
166/** 166/**
167 ** prototypes for helper functions in this file 167 ** prototypes for helper functions in this file
@@ -494,9 +494,9 @@ char *
494line_fullname(char *dst, const char *src, int dstsize) 494line_fullname(char *dst, const char *src, int dstsize)
495{ 495{
496 memset(dst, '\0', dstsize); 496 memset(dst, '\0', dstsize);
497 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) 497 if ((strncmp(src, "/dev/", 5) == 0) || (dstsize < (strlen(src) + 5))) {
498 strlcpy(dst, src, dstsize); 498 strlcpy(dst, src, dstsize);
499 else { 499 } else {
500 strlcpy(dst, "/dev/", dstsize); 500 strlcpy(dst, "/dev/", dstsize);
501 strlcat(dst, src, dstsize); 501 strlcat(dst, src, dstsize);
502 } 502 }
@@ -508,8 +508,13 @@ char *
508line_stripname(char *dst, const char *src, int dstsize) 508line_stripname(char *dst, const char *src, int dstsize)
509{ 509{
510 memset(dst, '\0', dstsize); 510 memset(dst, '\0', dstsize);
511#ifdef sgi
512 if (strncmp(src, "/dev/tty", 8) == 0)
513 strlcpy(dst, src + 8, dstsize);
514#else
511 if (strncmp(src, "/dev/", 5) == 0) 515 if (strncmp(src, "/dev/", 5) == 0)
512 strlcpy(dst, &src[5], dstsize); 516 strlcpy(dst, src + 5, dstsize);
517#endif
513 else 518 else
514 strlcpy(dst, src, dstsize); 519 strlcpy(dst, src, dstsize);
515 return dst; 520 return dst;
@@ -529,8 +534,13 @@ line_abbrevname(char *dst, const char *src, int dstsize)
529 memset(dst, '\0', dstsize); 534 memset(dst, '\0', dstsize);
530 535
531 /* Always skip prefix if present */ 536 /* Always skip prefix if present */
537#ifdef sgi
538 if (strncmp(src, "/dev/tty", 8) == 0)
539 src += 8;
540#else
532 if (strncmp(src, "/dev/", 5) == 0) 541 if (strncmp(src, "/dev/", 5) == 0)
533 src += 5; 542 src += 5;
543#endif
534 544
535 len = strlen(src); 545 len = strlen(src);
536 546