Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/lib/libedit Pull up 1.17 (approved by thorpej): only lo...



details:   https://anonhg.NetBSD.org/src/rev/043cdfea4403
branches:  netbsd-1-5
changeset: 488316:043cdfea4403
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Wed Jun 28 22:09:04 2000 +0000

description:
Pull up 1.17 (approved by thorpej): only look for .editrc in /d1/sommerfeld

diffstat:

 lib/libedit/el.c |  23 +++++++++++------------
 1 files changed, 11 insertions(+), 12 deletions(-)

diffs (44 lines):

diff -r 3ffc200dec52 -r 043cdfea4403 lib/libedit/el.c
--- a/lib/libedit/el.c  Wed Jun 28 18:24:14 2000 +0000
+++ b/lib/libedit/el.c  Wed Jun 28 22:09:04 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: el.c,v 1.16 2000/05/15 12:15:38 christos Exp $ */
+/*     $NetBSD: el.c,v 1.16.4.1 2000/06/28 22:09:04 sommerfeld Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)el.c       8.2 (Berkeley) 1/3/94";
 #else
-__RCSID("$NetBSD: el.c,v 1.16 2000/05/15 12:15:38 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.16.4.1 2000/06/28 22:09:04 sommerfeld Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -406,16 +406,15 @@
 
     fp = NULL;
     if (fname == NULL) {
-       fname = &elpath[1];
-       if ((fp = fopen(fname, "r")) == NULL) {
-           if ((ptr = getenv("HOME")) == NULL)
-               return -1;
-           if (strlcpy(path, ptr,    sizeof(path)) >= sizeof(path))
-               return -1;
-           if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
-               return -1;
-           fname = path;
-       }
+       if (issetugid())
+           return -1;
+       if ((ptr = getenv("HOME")) == NULL)
+           return -1;
+       if (strlcpy(path, ptr,    sizeof(path)) >= sizeof(path))
+           return -1;
+       if (strlcat(path, elpath, sizeof(path)) >= sizeof(path))
+           return -1;
+       fname = path;
     }
     if (fp == NULL)
        fp = fopen(fname, "r");



Home | Main Index | Thread Index | Old Index