🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.bash.bug
Article #437

Arrg! Bug in my bugfix!

#437
From: Ray Moody
Date: Sat, 05 Aug 1989 19:29
34 lines
1558 bytes
    There was a bug in my bugfix for polite_directory_format.  I was
trying to fix it so that /a/raymond would not appear as ~mond if my
home directory was /a/ray.  In reality, I broke it so that it would
never use a ~.  Here is a correct (i hope) patch.

    Sorry about this.  I guess I will go spend my 10 minutes in the
agonizer booth now.

								Ray
-------------------------------------------------------------------------------
RCS file: RCS/builtins.c,v
retrieving revision 1.2.1.1
diff -c -r1.2.1.1 builtins.c
*** /tmp/,RCSt1011325	Sat Aug  5 14:28:00 1989
--- builtins.c	Fri Aug  4 21:42:24 1989
***************
*** 2680,2686
    char *home = get_string_value ("HOME");
    int l = home ? strlen (home) : 0;
  
!   if (l && strncmp (home, name, l) == 0) {
      strcpy (tdir + 1, name + l);
      tdir[0] = '~';
      return (tdir);

--- 2680,2686 -----
    char *home = get_string_value ("HOME");
    int l = home ? strlen (home) : 0;
  
!   if (l > 1 && strncmp (home, name, l) == 0 && (name[l] == '/' || name[l] == '\0')) {
      strcpy (tdir + 1, name + l);
      tdir[0] = '~';
      return (tdir);
Technical Details
Message-ID: <8908051929.AA11331@maxwell.physics.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MAXWELL.PHYSICS.PURDUE.EDU!ray

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!MAXWELL.PHYSICS.PURDUE.EDU!ray
From: ray@MAXWELL.PHYSICS.PURDUE.EDU (Ray Moody)
Newsgroups: gnu.bash.bug
Subject: Arrg! Bug in my bugfix!
Message-ID: <8908051929.AA11331@maxwell.physics.purdue.edu>
Date: 5 Aug 89 19:29:13 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 34