-/* mangle.c -- encode long filenames
- Copyright (C) 1988, 1992 Free Software Foundation
-
-This file is part of GNU Tar.
-
-GNU Tar 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.
-
-GNU Tar 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 GNU Tar; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-time_t time();
-
-#include "tar.h"
-#include "port.h"
-
-void add_buffer();
-extern PTR ck_malloc();
-void finish_header();
-extern PTR init_buffer();
-extern char *quote_copy_string();
-extern char *get_buffer();
-char *un_quote_string();
-
-extern union record *start_header();
-
-extern struct stat hstat; /* Stat struct corresponding */
-
-struct mangled {
- struct mangled *next;
- int type;
- char mangled[NAMSIZ];
- char *linked_to;
- char normal[1];
-};
-
-
-/* Should use a hash table, etc. . */
-struct mangled *first_mangle;
-int mangled_num = 0;
-
-#if 0 /* Deleted because there is now a better way to do all this */
-
-char *
-find_mangled (name)
-char *name;
-{
- struct mangled *munge;
-
- for(munge=first_mangle;munge;munge=munge->next)
- if(!strcmp(name,munge->normal))
- return munge->mangled;
- return 0;
-}
-
-
-#ifdef S_ISLNK
+/* Encode long filenames for GNU tar.
+ Copyright 1988, 92, 94, 96, 97, 99, 2000 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 2, 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. */
+
+#include <system.h>
+#include "common.h"
+#include <quotearg.h>
+
+struct mangled
+ {
+ struct mangled *next;
+ int type;
+ char mangled[NAME_FIELD_SIZE];
+ char *linked_to;
+ char normal[1];
+ };
+
+/* Extract a GNUTYPE_NAMES record contents. It seems that such are
+ not produced anymore by GNU tar, but we leave the reading code
+ around nevertheless, for salvaging old tapes. */