zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: 3.1.6-test-2: Premature `return' in cancd2()
@ 1999-07-21  6:15 Bart Schaefer
  1999-07-21  6:22 ` PATCH: " Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Bart Schaefer @ 1999-07-21  6:15 UTC (permalink / raw)
  To: zsh-workers

The last few lines of cancd2() in exec.c are:

    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
    if (us2)
	free(us2);

Surely those lines are in the wrong order.

Index: Src/exec.c
===========================================================================
 	fixdir(us2 = us);
     } else
 	us = unmeta(s);
-    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
     if (us2)
 	free(us2);
+    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
 }
 
 /**/

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

* PATCH: Re: PATCH: 3.1.6-test-2: Premature `return' in cancd2()
  1999-07-21  6:15 PATCH: 3.1.6-test-2: Premature `return' in cancd2() Bart Schaefer
@ 1999-07-21  6:22 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-07-21  6:22 UTC (permalink / raw)
  To: zsh-workers

On Jul 21,  6:15am, Bart Schaefer wrote:
} Subject: PATCH: 3.1.6-test-2: Premature `return' in cancd2()
}
} Surely those lines are in the wrong order.

Surely I've been up too late too often recently.  It's actually a good thing
that I snipped one too many lines from the header of the previous attempt,
so you probably can't even apply 7229; here's a better try (ignore 7229).

Index: Src/exec.c
===========================================================================
@@ -3145,6 +3145,7 @@
 {
     struct stat buf;
     char *us, *us2 = NULL;
+    int ret;
 
     /*
      * If CHASEDOTS and CHASELINKS are not set, we want to rationalize the
@@ -3159,9 +3160,10 @@
 	fixdir(us2 = us);
     } else
 	us = unmeta(s);
-    return !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
+    ret = !(access(us, X_OK) || stat(us, &buf) || !S_ISDIR(buf.st_mode));
     if (us2)
 	free(us2);
+    return ret;
 }
 
 /**/

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-07-21  6:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-07-21  6:15 PATCH: 3.1.6-test-2: Premature `return' in cancd2() Bart Schaefer
1999-07-21  6:22 ` PATCH: " Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).