Return to BSD News archive
Received: by minnie.vk1xwt.ampr.org with NNTP
id AA1483 ; Tue, 23 Feb 93 14:43:34 EST
Path: sserve!manuel.anu.edu.au!munnari.oz.au!bruce.cs.monash.edu.au!monu6!escargot!minyos.xx.rmit.OZ.AU!s902113
From: s902113@minyos.xx.rmit.OZ.AU (Luke Mewburn)
Newsgroups: comp.unix.bsd
Subject: [386bsd, net/2] csh additions
Date: 18 Feb 1993 16:26:56 GMT
Organization: RMIT Computer Centre
Lines: 68
Message-ID: <1m0dcgINNaja@escargot.xx.rmit.OZ.AU>
NNTP-Posting-Host: minyos.xx.rmit.oz.au
Hack to csh to handle the 'set nodot' and 'set dotfiles' options which
use the respective additions to the glob code I post just before this
article. The hacks will only compile in if the previous patch was
applied to glob.c and <glob.h> anyway.
The new 'set's are:
nodot - don't glob . or ..
dotfiles - glob .files w/o needing a . at the start of the
pattern.
*** const.c.PZ Sat Feb 13 16:05:32 1993
--- const.c Sat Feb 13 16:38:57 1993
***************
*** 40,45 ****
--- 40,46 ----
*/
#include "csh.h"
+ #include <glob.h>
Char STR0[] = { '0', '\0' };
Char STR1[] = { '1', '\0' };
***************
*** 79,84 ****
--- 80,88 ----
Char STRdefault[] = { 'd', 'e', 'f', 'a', 'u', 'l', 't', '\0' };
Char STRdot[] = { '.', '\0' };
Char STRdotdotsl[] = { '.', '.', '/', '\0' };
+ #ifdef GLOB_DOTFILES
+ Char STRdotfiles[] = { 'd', 'o', 't', 'f', 'i', 'l', 'e', 's', '\0' };
+ #endif
Char STRdotsl[] = { '.', '/', '\0' };
Char STRecho[] = { 'e', 'c', 'h', 'o', '\0' };
Char STRequal[] = { '=', '\0' };
***************
*** 109,114 ****
--- 113,121 ----
Char STRnice[] = { 'n', 'i', 'c', 'e', '\0' };
Char STRnobeep[] = { 'n', 'o', 'b', 'e', 'e', 'p', '\0' };
Char STRnoclobber[] = { 'n', 'o', 'c', 'l', 'o', 'b', 'b', 'e', 'r', '\0' };
+ #ifdef GLOB_NODOT
+ Char STRnodot[] = { 'n', 'o', 'd', 'o', 't', '\0' };
+ #endif
Char STRnoglob[] = { 'n', 'o', 'g', 'l', 'o', 'b', '\0' };
Char STRnohup[] = { 'n', 'o', 'h', 'u', 'p', '\0' };
Char STRnonomatch[] = { 'n', 'o', 'n', 'o', 'm', 'a', 't', 'c', 'h', '\0' };
*** glob.c.PZ Sat Feb 13 16:05:39 1993
--- glob.c Sat Feb 13 16:11:28 1993
***************
*** 362,367 ****
--- 362,376 ----
globv.gl_pathv = 0;
globv.gl_pathc = 0;
nonomatch = adrof(STRnonomatch) != 0;
+ /* dotfiles & nodot added 930213 by Luke Mewburn <zak@rmit.edu.au> */
+ #ifdef GLOB_DOTFILES
+ if (adrof(STRdotfiles))
+ gflgs |= GLOB_DOTFILES;
+ #endif
+ #ifdef GLOB_NODOT
+ if (adrof(STRnodot))
+ gflgs |= GLOB_NODOT;
+ #endif
do {
ptr = short2qstr(*vl);
switch (glob(ptr, gflgs, 0, &globv)) {