X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgetcwd.c;h=a185ef3c6b7cc7eee0b871f570fa0aaa27f8030f;hb=57fdfd3f8ec62b105c53bcdf6f127c35c7fe7391;hp=dea0ebcac45f4f5d4b37b8eb887224ef778dc0db;hpb=788ab9bcd51307ffb600856bbb2485e3c6b515a3;p=pspp diff --git a/lib/getcwd.c b/lib/getcwd.c index dea0ebcac4..a185ef3c6b 100644 --- a/lib/getcwd.c +++ b/lib/getcwd.c @@ -2,23 +2,23 @@ Foundation, Inc. This file is part of the GNU C Library. - This program is free software; you can redistribute it and/or modify + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, - Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ #if !_LIBC # include # include +# include "dirfd.h" #endif #include @@ -390,7 +390,7 @@ __getcwd (char *buf, size_t size) used = dir + allocated - dirp; memmove (dir, dirp, used); - if (buf == NULL && size == 0) + if (size == 0) /* Ensure that the buffer is only as large as necessary. */ buf = realloc (dir, used);