From: Roman Neuhauser Date: Mon, 28 Mar 2011 09:18:21 +0000 (-0400) Subject: archive_write.3: indentation fixes in example X-Git-Tag: v3.0.0a~576 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c0410f8ea9fd6a3bc090aa1a2fb46c360eea085;p=thirdparty%2Flibarchive.git archive_write.3: indentation fixes in example SVN-Revision: 3102 --- diff --git a/libarchive/archive_write.3 b/libarchive/archive_write.3 index f5eb0529a..1fa4245a4 100644 --- a/libarchive/archive_write.3 +++ b/libarchive/archive_write.3 @@ -137,8 +137,8 @@ system calls. #include struct mydata { - const char *name; - int fd; + const char *name; + int fd; }; int @@ -194,12 +194,12 @@ write_archive(const char *outname, const char **filename) archive_entry_set_pathname(entry, *filename); archive_write_header(a, entry); if ((fd = open(*filename, O_RDONLY)) != -1) { + len = read(fd, buff, sizeof(buff)); + while ( len > 0 ) { + archive_write_data(a, buff, len); len = read(fd, buff, sizeof(buff)); - while ( len > 0 ) { - archive_write_data(a, buff, len); - len = read(fd, buff, sizeof(buff)); - } - close(fd); + } + close(fd); } archive_entry_free(entry); filename++; @@ -209,11 +209,11 @@ write_archive(const char *outname, const char **filename) int main(int argc, const char **argv) { - const char *outname; - argv++; - outname = argv++; - write_archive(outname, argv); - return 0; + const char *outname; + argv++; + outname = argv++; + write_archive(outname, argv); + return 0; } .Ed .Sh SEE ALSO