Fix from Craig Barratt <cbarratt@users.sourceforge.net> to fix restore
authorJeremy Allison <jra@samba.org>
Fri, 12 Sep 2003 01:25:35 +0000 (01:25 +0000)
committerJeremy Allison <jra@samba.org>
Fri, 12 Sep 2003 01:25:35 +0000 (01:25 +0000)
with filenames > 100 chars.
Jeremy.

source/client/clitar.c

index b01de5b8e705fc4a9c0486e0f7b69b7b3ac65552..f38d6fe91a5a728f2e28c99c6a9c8e799597025b 100644 (file)
@@ -1054,9 +1054,11 @@ static int get_dir(file_info2 finfo)
    has the data. We only want the long file name, as the loop in do_tarput
    will deal with the rest.
 */
-static char * get_longfilename(file_info2 finfo)
+static char *get_longfilename(file_info2 finfo)
 {
-       int namesize = strlen(finfo.name) + strlen(cur_dir) + 2;
+       /* finfo.size here is the length of the filename as written by the "/./@LongLink" name
+        * header call. */
+       int namesize = finfo.size + strlen(cur_dir) + 2;
        char *longname = malloc(namesize);
        int offset = 0, left = finfo.size;
        BOOL first = True;