From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: emacs & MAXPATHLEN Date: Sat, 30 Jul 2005 13:56:33 +0300 Message-ID: References: <87fytzj6a7.fsf@gmail.com> <87pst2h35e.fsf@gmail.com> <87r7dhxenv.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1122721220 18348 80.91.229.2 (30 Jul 2005 11:00:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 30 Jul 2005 11:00:20 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 30 13:00:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dyp4W-0004rd-7L for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 13:00:04 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyp72-0001xp-RV for ged-emacs-devel@m.gmane.org; Sat, 30 Jul 2005 07:02:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dyp61-0001xE-Dh for emacs-devel@gnu.org; Sat, 30 Jul 2005 07:01:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dyp5z-0001wR-MQ for emacs-devel@gnu.org; Sat, 30 Jul 2005 07:01:37 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dyp5z-0001vZ-CZ for emacs-devel@gnu.org; Sat, 30 Jul 2005 07:01:35 -0400 Original-Received: from [192.114.186.66] (helo=romy.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DypCn-0000KS-Fb; Sat, 30 Jul 2005 07:08:37 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-80-230-38-154.inter.net.il [80.230.38.154]) by romy.inter.net.il (MOS 3.5.8-GR) with ESMTP id BZJ48526 (AUTH halo1); Sat, 30 Jul 2005 13:56:33 +0300 (IDT) Original-To: Giuseppe Scrivano In-reply-to: <87r7dhxenv.fsf@gmail.com> (message from Giuseppe Scrivano on Sat, 30 Jul 2005 03:31:48 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41334 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41334 > From: Giuseppe Scrivano > Date: Sat, 30 Jul 2005 03:31:48 +0200 > Cc: emacs-devel@gnu.org > > + if(getcwd (buf, MAXPATHLEN + 1) == 0) > + fatal ("`getwd' failed: %s\n", buf); The error message mentions the wrong function here. I also wonder whether we should keep the "#ifdef MAXPATHLEN" branch, or just use the loop below on all platforms that have getcwd. > +#else > + { > + int buf_size = 2; > + buf = xmalloc (buf_size); > + for(;;) > + { > + if(getcwd (buf, buf_size) == 0) > + { > + if(errno == ERANGE) > + { > + buf_size *= 2; > + buf = xrealloc (buf, buf_size); > + } > + else > + fatal ("`getcwd' failed: %s\n", strerror (errno)); > + } > + else > + break; > + } > + > + } > +#endif