Fixed UUE multisection decoding

This commit is contained in:
Ianos Gnatiuc 2006-12-05 19:32:15 +00:00
parent 67194e2060
commit 5ed68936ee
3 changed files with 15 additions and 1 deletions

View File

@ -10,6 +10,12 @@ _____________________________________________________________________________
‡ ¬¥âª¨ ¤«ï GoldED+ 1.1.5, /snapshot/
_____________________________________________________________________________
- uudecoder: ⥯¥àì ¡ã¤¥â ¯à®¨£­®à¨à®¢ ­® ¢á¥ ¯®á«¥ áâப ¯® ¬ áª¥
"sum -r/size [0-9]+/[0-9]+ section.*" ¨«¨ "section [0-9]+ end.*"
! §­ ç¥­¨¥ ¯® 㬮«ç ­¨î ¤«ï UseTZUTC ¨§¬¥­¥­® ­  "yes".
‘­ ¯è®â ®â 16 ­®ï¡àï 2006.
+ ’¥¯¥àì ª§è¨àã¥âáï ¯®á«¥¤­¨© ®âªàëâë© âàí¤, ç⮠ᨫ쭮 ¯®¢ëᨫ® ᪮à®áâì
¯®¢â®à­®£® ¥£® ®âªàëâ¨ï. Žá®¡¥­­® íâ® § ¬¥â­® ­  READGotoThNextUnread.
+ Š®£¤  á®®¡é¥­¨¥ ¯¥à¥¬¥é ¥âáï ¨§ ª®à§¨­ë, â® ¢ë¡¨à ¥âáï ¯® 㬮«ç ­¨î  à¨ï

View File

@ -10,6 +10,9 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
- uudecoder: now are skipped all lines which follows lines with mask
"sum -r/size [0-9]+/[0-9]+ section.*" or "section [0-9]+ end.*"
! UseTZUTC default value changed from "no" to "yes".
= Snapshot for the Nov 16, 2006.

View File

@ -54,6 +54,7 @@
#include <gdefs.h>
#include <gctype.h>
#include <gcrcall.h>
#include <gregex.h>
#include <uudeview.h>
#include <uuint.h>
#include <fptools.h>
@ -942,6 +943,10 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
*state = BEGIN;
}
gregex regexp1, regexp2;
regexp1.compile("sum -r/size [0-9]+/[0-9]+ section.*", gregex::extended | gregex::icase);
regexp2.compile("section [0-9]+ end.*", gregex::extended | gregex::icase);
bool endsection = false;
while (!feof(datain) && (*state != DONE) &&
@ -959,7 +964,7 @@ UUDecodePart (FILE *datain, FILE *dataout, int *state,
return UURET_IOERR;
}
if ((method == UU_ENCODED) && !strncmp(line, "sum -r/size ", 12))
if ((method == UU_ENCODED) && (regexp1.match(line) || regexp2.match(line)))
{
endsection = true;
}