1 /* This program is free software; you can redistribute it and/or modify
2 it under the terms of the GNU General Public License as published by
3 the Free Software Foundation; either version 2, or (at your option)
4 any later version.
5
6 This program is distributed in the hope that it will be useful,
7 but WITHOUT ANY WARRANTY; without even the implied warranty of
8 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 GNU General Public License for more details. */
10
11 #include <unixlib.h>
12
13 #include "cvs.h"
14
15 /* Return the current directory, newly allocated, arbitrarily long.
16 Return NULL and set errno on error. */
17 char *
xgetwd()18 xgetwd ()
19 {
20 char pathname[256];
21
22 return xstrdup (getcwd (pathname, sizeof (pathname) - 2, 0));
23 }
24