X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Received: by 10.224.110.68 with SMTP id m4mr10916647qap.2.1364368563049; Wed, 27 Mar 2013 00:16:03 -0700 (PDT) X-Received: by 10.49.95.134 with SMTP id dk6mr1289817qeb.10.1364368562951; Wed, 27 Mar 2013 00:16:02 -0700 (PDT) Newsgroups: comp.os.msdos.djgpp Date: Wed, 27 Mar 2013 00:16:02 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse AT google DOT com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2.173.27.66; posting-account=v5xbdQoAAAAOGc9Ccc-kLZyobvPlN3Qr NNTP-Posting-Host: 2.173.27.66 References: <261476b1-c137-495d-95df-a92075cd9960 AT googlegroups DOT com> <2245ebea-be44-4a40-8b2f-7ef5e0e67157 AT googlegroups DOT com> <5f806b56-af98-4f72-8984-a944be9348a4 AT googlegroups DOT com> <6b49a77b-dcba-4c23-8a29-4ac0263e7713 AT googlegroups DOT com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: DJGPP scandir and alphasort example code From: Georg Potthast Cc: djgpp AT delorie DOT com Injection-Date: Wed, 27 Mar 2013 07:16:03 +0000 Content-Type: text/plain; charset=ISO-8859-1 Bytes: 2219 Lines: 15 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id r2RG046M002965 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk Am Dienstag, 26. März 2013 23:19:08 UTC+1 schrieb RayeR: > > I do have long filenames in C:\ e.g. "VirtualBox-3.2.10-66523-Win.exe". It does not crash though. > > > > And did you tried with some LFNs containing SPACES? Yes, that was no problem. It seems the problem is that glob and readdir result in different file numbers for a directory. Therefore sometimes there is not enough memory allocated causing memory overrides. Adding some additional memory to be on the safe side should fix it: cnt = glob_results.gl_pathc +2; //add two for . and .. cnt += 100; //glob and readdir report different file numbers