105 lines
3.6 KiB
Plaintext
105 lines
3.6 KiB
Plaintext
*** zipnote.c.orig Mon Apr 1 12:10:51 1996
|
|
--- zipnote.c Tue Nov 25 16:28:00 1997
|
|
***************
|
|
*** 403,409 ****
|
|
|
|
/* Process stdin, replacing comments */
|
|
z = zfiles;
|
|
! while (gets(a) != NULL && (a[0] != MARK || strcmp(a + 1, MARKZ)))
|
|
{ /* while input and not file comment */
|
|
if (a[0] != MARK || a[1] != ' ') /* better be "@ name" */
|
|
ziperr(ZE_NOTE, "unexpected input");
|
|
--- 403,409 ----
|
|
|
|
/* Process stdin, replacing comments */
|
|
z = zfiles;
|
|
! while (fgets(a, FNMAX, stdin) != NULL && (a[0] != MARK || strcmp(a + 1, MARKZ)))
|
|
{ /* while input and not file comment */
|
|
if (a[0] != MARK || a[1] != ' ') /* better be "@ name" */
|
|
ziperr(ZE_NOTE, "unexpected input");
|
|
***************
|
|
*** 411,417 ****
|
|
z = z->nxt; /* allow missing entries in order */
|
|
if (z == NULL)
|
|
ziperr(ZE_NOTE, "unknown entry name");
|
|
! if (gets(a) != NULL && a[0] == MARK && a[1] == '=')
|
|
{
|
|
if (z->name != z->zname)
|
|
free((zvoid *)z->zname);
|
|
--- 411,417 ----
|
|
z = z->nxt; /* allow missing entries in order */
|
|
if (z == NULL)
|
|
ziperr(ZE_NOTE, "unknown entry name");
|
|
! if (fgets(a, FNMAX, stdin) != NULL && a[0] == MARK && a[1] == '=')
|
|
{
|
|
if (z->name != z->zname)
|
|
free((zvoid *)z->zname);
|
|
***************
|
|
*** 422,428 ****
|
|
* Don't update z->nam here, we need the old value a little later.....
|
|
* The update is handled in zipcopy().
|
|
*/
|
|
! gets(a);
|
|
}
|
|
if (z->com) /* change zip entry comment */
|
|
free((zvoid *)z->comment);
|
|
--- 422,428 ----
|
|
* Don't update z->nam here, we need the old value a little later.....
|
|
* The update is handled in zipcopy().
|
|
*/
|
|
! fgets(a, FNMAX, stdin);
|
|
}
|
|
if (z->com) /* change zip entry comment */
|
|
free((zvoid *)z->comment);
|
|
***************
|
|
*** 431,437 ****
|
|
{
|
|
if ((r = catalloc(&(z->comment), a)) != ZE_OK)
|
|
ziperr(r, "was building new comments");
|
|
! gets(a);
|
|
}
|
|
z->com = strlen(z->comment);
|
|
z = z->nxt; /* point to next entry */
|
|
--- 431,437 ----
|
|
{
|
|
if ((r = catalloc(&(z->comment), a)) != ZE_OK)
|
|
ziperr(r, "was building new comments");
|
|
! fgets(a, FNMAX, stdin);
|
|
}
|
|
z->com = strlen(z->comment);
|
|
z = z->nxt; /* point to next entry */
|
|
***************
|
|
*** 439,452 ****
|
|
if (a != NULL) /* change zip file comment */
|
|
{
|
|
zcomment = malloc(1); *zcomment = 0;
|
|
! while (gets(a) != NULL)
|
|
if ((r = catalloc(&zcomment, a)) != ZE_OK)
|
|
ziperr(r, "was building new comments");
|
|
zcomlen = strlen(zcomment);
|
|
}
|
|
|
|
/* Open output zip file for writing */
|
|
! if ((tempzf = y = fopen(tempzip = tempname(zipfile), FOPW)) == NULL)
|
|
ziperr(ZE_TEMP, tempzip);
|
|
|
|
/* Open input zip file again, copy preamble if any */
|
|
--- 439,455 ----
|
|
if (a != NULL) /* change zip file comment */
|
|
{
|
|
zcomment = malloc(1); *zcomment = 0;
|
|
! while (fgets(a, FNMAX, stdin) != NULL)
|
|
if ((r = catalloc(&zcomment, a)) != ZE_OK)
|
|
ziperr(r, "was building new comments");
|
|
zcomlen = strlen(zcomment);
|
|
}
|
|
|
|
/* Open output zip file for writing */
|
|
! tempzip = tempname(zipfile, y);
|
|
! tempzf = y;
|
|
!
|
|
! if ((tempzf == NULL) || (tempzip == NULL))
|
|
ziperr(ZE_TEMP, tempzip);
|
|
|
|
/* Open input zip file again, copy preamble if any */
|