🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #379

completion on sockets

#379
From: James J Dempsey
Date: Tue, 25 Jul 1989 13:52
30 lines
1179 bytes
I'm running on a Sun 3/60, Sun OS 4.0.3, compiled with cc and yacc.

A minor nit:

Asking bash to complete on a socket in the file system (like
/tmp/.X11-unix/X0 if you run X)  will result in bash thinking the
socket is a directory:

$ ls /tmp/.X11-unix/X0/

The offending piece of code in readline.c looks like this:


		  if ((stat (filename, &finfo) == 0) &&
		      (finfo.st_mode & S_IFDIR))
		    {
		      if (the_line[rl_point] != '/')
			rl_insert_text ("/");
		    }
		  else


Since S_IFDIR (on Sun OS) is 0040000 and S_IFSOCK is 0140000 I guess
the only thing to do is to check if st_mode is S_IFDIR and *not*
S_IFSOCK. 

		--Jim Dempsey--
		BBN Communications
		jjd@bbn.com (ARPA Internet)
                ..!{decvax, harvard, wjh12, linus}!bbn!jjd
Technical Details
Message-ID: <8907251402.AA11526@life.ai.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!BBN.COM!jjd

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!BBN.COM!jjd
From: jjd@BBN.COM (James J Dempsey)
Newsgroups: gnu.bash.bug
Subject: completion on sockets
Message-ID: <8907251402.AA11526@life.ai.mit.edu>
Date: 25 Jul 89 13:52:37 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 30