From a095b9c73f948d7d4f926f2ca9c0fcf4c955335f Mon Sep 17 00:00:00 2001 From: oga Date: Fri, 29 Aug 2008 13:07:13 +0000 Subject: [PATCH] Fix nvi's cscope support in the case that someone provided a filename without a directory (e.g. :cscope add cscope.out). Found and fixed by Paul Irofti, with help from me; Thanks! upstream nvi also has this fix. ok otto@. --- usr.bin/vi/ex/ex_cscope.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/vi/ex/ex_cscope.c b/usr.bin/vi/ex/ex_cscope.c index dc7a66de5b2..56093878711 100644 --- a/usr.bin/vi/ex/ex_cscope.c +++ b/usr.bin/vi/ex/ex_cscope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ex_cscope.c,v 1.14 2007/09/11 15:47:17 gilles Exp $ */ +/* $OpenBSD: ex_cscope.c,v 1.15 2008/08/29 13:07:13 oga Exp $ */ /*- * Copyright (c) 1994, 1996 @@ -246,6 +246,10 @@ cscope_add(sp, cmdp, dname) dbname = CSCOPE_DBFILE; } else if ((dbname = strrchr(dname, '/')) != NULL) *dbname++ = '\0'; + else { + dbname = dname; + dname = "."; + } /* Allocate a cscope connection structure and initialize its fields. */ len = strlen(dname); -- 2.20.1