Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: jeffdbREMOVETHIS AT goodnet DOT com (Mikey) To: cygwin AT sourceware DOT cygnus DOT com Cc: cygwin-developers AT sourceware DOT cygnus DOT com, earnie_boyd AT yahoo DOT com, JRSON AT netzero DOT net Subject: BUGFIX!! ash == /bin/sh fixed for ./configure w95 & NT4 Date: Sun, 13 Jun 1999 02:16:02 GMT Organization: Never Reply-To: jeffdbREMOVETHIS AT goodnet DOT com Message-ID: <37630f82.4146511@mail.goodnet.com> X-Mailer: Forte Agent 1.5/32.452 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit First Thanks to John Hanson and Earnie Boyd, for their contributions to this fix. Trying Mr Hanson's JIT patch for gdb that he posted last week,(works NICE!) running configure for binutils cvs with ash as /bin/sh gets 6 segfaults in various dirs. Sorry Mr Hanson I don't have W2K or 98 so I can't help with your question :-( The final patched sh.exe correctly configures binutils+gcc+gdb on both w95 and NT4 sp3. NO SEGFAULTS!!!!. Here files still mess up stdin on 95, with 990115 snap, but I understand that this is fixed in more recent snaps. Now if I could just get a recent snap to work on 95 ;-) I noticed that most of the errors were memory allocation related, so I decided to take Earnie's advice and link sh.exe against libmmalloc.a finally the only error left was in expand.c, the fix below may be a little excessive, but in this case I think if it's not needed now, it will be in future. At first I just changed the size to 4096 from 1024, and that worked. --- ../ash1/expand.c Thu Feb 18 11:37:24 1999 +++ expand.c Sat Jun 12 17:20:12 1999 @@ -63,6 +63,11 @@ #include #include #include +#ifdef __CYGWIN__ +#include +#else +#define PATH_MAX 1024 +#endif /* * Structure specifying which parts of the string should be searched @@ -646,6 +651,8 @@ struct strlist **savelastp; struct strlist *sp; char c; + int metamax = 0; + int hasmeta = 0; while (str) { if (fflag) @@ -655,16 +662,16 @@ if (p[0] == '/' && p[1] == 'u' && p[2] == '/') str->text = p = expudir(p); #endif - for (;;) { /* fast check for meta chars */ - if ((c = *p++) == '\0') - goto nometa; - if (c == '*' || c == '?' || c == '[' || c == '!') - break; + for (;;) { + if ((c = *p++) == '\0' && !hasmeta) goto nometa; + else if (c = '\0') break; + if (c == '*'){ metamax++; hasmeta++;} + if ( c == '[' || c == '!' || c == '?') hasmeta++; } savelastp = exparg.lastp; INTOFF; if (expdir == NULL) - expdir = ckmalloc(1024); /* I hope this is big enough */ + expdir = ckmalloc(4096 + (PATH_MAX * metamax)); expmeta(expdir, str->text); ckfree(expdir); expdir = NULL; -- Want to unsubscribe from this list? Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com