mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-03-09 15:50:02 +00:00
Remove code related to long-dead 3DFS research project
This commit gets rid of dead weight related to an obscure early 1990s Bell Labs versioning file system research project called 3DFS, which has not existed for decades and for which I have not managed to find any evidence that it was ever used outside the lab. This removes: - the SHOPT_FS_3D compile option (which was forced on even when 0) - the obnoxious default alias 2d='set -f;_2d' that turned off your globbing and then tried to run a nonexistent _2d command - undocumented builtins 'vmap' and 'vpath' that only errored out - a non-functional -V unary operator for the test and [[ commands - some specific code for Apollo workstations (last made in 1997), which was inseparably intertwined with the 3DFS code (cherry picked from commit 20cdf3709f4fb4e468057b534dcee819b1961fb6)
This commit is contained in:
parent
5f8b0512f0
commit
f88f302c38
19 changed files with 9 additions and 279 deletions
|
@ -167,17 +167,9 @@ int b_cd(int argc, char *argv[],Shbltin_t *context)
|
|||
{
|
||||
register char *cp;
|
||||
stakseek(PATH_MAX+PATH_OFFSET);
|
||||
#if SHOPT_FS_3D
|
||||
if(!(cp = pathcanon(stakptr(PATH_OFFSET),PATH_DOTDOT)))
|
||||
continue;
|
||||
/* eliminate trailing '/' */
|
||||
while(*--cp == '/' && cp>stakptr(PATH_OFFSET))
|
||||
*cp = 0;
|
||||
#else
|
||||
if(*(cp=stakptr(PATH_OFFSET))=='/')
|
||||
if(!pathcanon(cp,PATH_DOTDOT))
|
||||
continue;
|
||||
#endif /* SHOPT_FS_3D */
|
||||
}
|
||||
if((rval=chdir(path_relative(shp,stakptr(PATH_OFFSET)))) >= 0)
|
||||
goto success;
|
||||
|
@ -255,15 +247,7 @@ int b_pwd(int argc, char *argv[],Shbltin_t *context)
|
|||
errormsg(SH_DICT,ERROR_system(1), e_pwd);
|
||||
if(flag)
|
||||
{
|
||||
#if SHOPT_FS_3D
|
||||
if(shp->gd->lim.fs3d && (flag = mount(e_dot,NIL(char*),FS3D_GET|FS3D_VIEW,0))>=0)
|
||||
{
|
||||
cp = (char*)stakseek(++flag+PATH_MAX);
|
||||
mount(e_dot,cp,FS3D_GET|FS3D_VIEW|FS3D_SIZE(flag),0);
|
||||
}
|
||||
else
|
||||
#endif /* SHOPT_FS_3D */
|
||||
cp = strcpy(stakseek(strlen(cp)+PATH_MAX),cp);
|
||||
cp = strcpy(stakseek(strlen(cp)+PATH_MAX),cp);
|
||||
pathcanon(cp,PATH_PHYSICAL);
|
||||
}
|
||||
sfputr(sfstdout,cp,'\n');
|
||||
|
|
|
@ -220,25 +220,6 @@ int b_hist(int argc,char *argv[], Shbltin_t *context)
|
|||
if(*arg!='/')
|
||||
errormsg(SH_DICT,ERROR_exit(1),"ed not found set FCEDIT");
|
||||
}
|
||||
#ifdef apollo
|
||||
/*
|
||||
* Code to support the FC using the pad editor.
|
||||
* Exampled of how to use: HISTEDIT=pad
|
||||
*/
|
||||
if (strcmp (arg, "pad") == 0)
|
||||
{
|
||||
extern int pad_create(char*);
|
||||
sh_close(fdo);
|
||||
fdo = pad_create(fname);
|
||||
pad_wait(fdo);
|
||||
unlink(fname);
|
||||
strcat(fname, ".bak");
|
||||
unlink(fname);
|
||||
lseek(fdo,(off_t)0,SEEK_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* apollo */
|
||||
if(*arg != '-')
|
||||
{
|
||||
char *com[3];
|
||||
|
@ -250,9 +231,6 @@ int b_hist(int argc,char *argv[], Shbltin_t *context)
|
|||
fdo = sh_chkopen(fname);
|
||||
unlink(fname);
|
||||
free((void*)fname);
|
||||
#ifdef apollo
|
||||
}
|
||||
#endif /* apollo */
|
||||
/* don't history fc itself unless forked */
|
||||
error_info.flags |= ERROR_SILENT;
|
||||
if(!sh_isstate(SH_FORKED))
|
||||
|
|
|
@ -558,94 +558,3 @@ int b_universe(int argc, char *argv[],Shbltin_t *context)
|
|||
}
|
||||
#endif /* cmd_universe */
|
||||
|
||||
#if SHOPT_FS_3D
|
||||
#if _UWIN
|
||||
#include <sys/mount.h>
|
||||
#endif
|
||||
# if 0
|
||||
/* for the dictionary generator */
|
||||
int b_vmap(int argc,char *argv[], Shbltin_t *context){}
|
||||
# endif
|
||||
int b_vpath(register int argc,char *argv[], Shbltin_t *context)
|
||||
{
|
||||
register int flag, n;
|
||||
register const char *optstr;
|
||||
register char *vend;
|
||||
register Shell_t *shp = context->shp;
|
||||
if(argv[0][1]=='p')
|
||||
{
|
||||
optstr = sh_optvpath;
|
||||
flag = FS3D_VIEW;
|
||||
}
|
||||
else
|
||||
{
|
||||
optstr = sh_optvmap;
|
||||
flag = FS3D_VERSION;
|
||||
}
|
||||
while(n = optget(argv, optstr)) switch(n)
|
||||
{
|
||||
case ':':
|
||||
errormsg(SH_DICT,2, "%s", opt_info.arg);
|
||||
break;
|
||||
case '?':
|
||||
errormsg(SH_DICT,ERROR_usage(2), "%s",opt_info.arg);
|
||||
break;
|
||||
}
|
||||
if(error_info.errors)
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
#ifdef MS_3D
|
||||
flag |= MS_3D;
|
||||
#else
|
||||
if(!shp->gd->lim.fs3d)
|
||||
goto failed;
|
||||
#endif
|
||||
argv += opt_info.index;
|
||||
argc -= opt_info.index;
|
||||
switch(argc)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
flag |= FS3D_GET;
|
||||
if((n = mount(*argv,(char*)0,flag,0)) >= 0)
|
||||
{
|
||||
vend = stkalloc(shp->stk,++n);
|
||||
n = mount(*argv,vend,flag|FS3D_SIZE(n),0);
|
||||
}
|
||||
if(n < 0)
|
||||
goto failed;
|
||||
if(argc==1)
|
||||
{
|
||||
sfprintf(sfstdout,"%s\n",vend);
|
||||
break;
|
||||
}
|
||||
n = 0;
|
||||
while(flag = *vend++)
|
||||
{
|
||||
if(flag==' ')
|
||||
{
|
||||
flag = e_sptbnl[n+1];
|
||||
n = !n;
|
||||
}
|
||||
sfputc(sfstdout,flag);
|
||||
}
|
||||
if(n)
|
||||
sfputc(sfstdout,'\n');
|
||||
break;
|
||||
default:
|
||||
if((argc&1))
|
||||
errormsg(SH_DICT,ERROR_usage(2),"%s",optusage((char*)0));
|
||||
/*FALLTHROUGH*/
|
||||
case 2:
|
||||
if(shp->subshell && !shp->subshare)
|
||||
sh_subfork();
|
||||
for(n=0;n<argc;n+=2)
|
||||
if(mount(argv[n+1],argv[n],flag,0)<0)
|
||||
goto failed;
|
||||
}
|
||||
return(0);
|
||||
failed:
|
||||
errormsg(SH_DICT,ERROR_exit(1),(argc>1)?e_cantset:e_cantget,(flag&FS3D_VIEW)?e_mapping:e_versions);
|
||||
return(1);
|
||||
}
|
||||
#endif /* SHOPT_FS_3D */
|
||||
|
||||
|
|
|
@ -363,23 +363,6 @@ int test_unop(Shell_t *shp,register int op,register const char *arg)
|
|||
return(permission(arg, W_OK));
|
||||
case 'x':
|
||||
return(permission(arg, X_OK));
|
||||
case 'V':
|
||||
#if SHOPT_FS_3D
|
||||
{
|
||||
register int offset = staktell();
|
||||
if(stat(arg,&statb)<0 || !S_ISREG(statb.st_mode))
|
||||
return(0);
|
||||
/* add trailing / */
|
||||
stakputs(arg);
|
||||
stakputc('/');
|
||||
stakputc(0);
|
||||
arg = (const char*)stakptr(offset);
|
||||
stakseek(offset);
|
||||
/* FALL THRU */
|
||||
}
|
||||
#else
|
||||
return(0);
|
||||
#endif /* SHOPT_FS_3D */
|
||||
case 'd':
|
||||
return(test_stat(arg,&statb)>=0 && S_ISDIR(statb.st_mode));
|
||||
case 'c':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue