X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=lib%2Fchdir-long.h;fp=lib%2Fchdir-long.h;h=a0a44321342c729c378ae8c0f97959ddb5e4fea9;hb=a2016c1de6e4884f6c8ed5cc498f3bf821c25ca4;hp=0000000000000000000000000000000000000000;hpb=c7e61475680fa226bd9b8bdd469cd66914e630f5;p=debian%2Fgzip
diff --git a/lib/chdir-long.h b/lib/chdir-long.h
new file mode 100644
index 0000000..a0a4432
--- /dev/null
+++ b/lib/chdir-long.h
@@ -0,0 +1,34 @@
+/* provide a chdir function that tries not to fail due to ENAMETOOLONG
+ Copyright (C) 2004-2005, 2009-2010 Free Software Foundation, Inc.
+
+ 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 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, see . */
+
+/* Written by Jim Meyering. */
+
+#include
+#include
+
+#ifndef PATH_MAX
+# ifdef MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+# endif
+#endif
+
+/* On systems without PATH_MAX, presume that chdir accepts
+ arbitrarily long directory names. */
+#ifndef PATH_MAX
+# define chdir_long(Dir) chdir (Dir)
+#else
+int chdir_long (char *dir);
+#endif