# HG changeset patch # User Carl Byington # Date 1374775977 25200 # Node ID c5e7f13d28364f6250624b15f59900cc83bf3834 # Parent 93a2d4b162e43308e37190cf5ca29e7a0db3d480 .msg files should use only one of short or long filename fields diff -r 93a2d4b162e4 -r c5e7f13d2836 regression/regression-tests.bash --- a/regression/regression-tests.bash Wed Jun 12 21:34:35 2013 -0700 +++ b/regression/regression-tests.bash Thu Jul 25 11:12:57 2013 -0700 @@ -66,9 +66,11 @@ ## normal recursive dump char='us-ascii' + acc="-a '.xls,.doc'" + acc='' #char='BIG-5' - echo $val ../src/readpst -a '.xls,.doc' -C $char -j 0 -r -cv -o output$n -d $ba.log $fn - $val ../src/readpst -a '.xls,.doc' -C $char -j 0 -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1 + echo $val ../src/readpst $acc -C $char -j 0 -r -cv -o output$n -d $ba.log $fn + $val ../src/readpst $acc -C $char -j 0 -r -cv -o output$n -d $ba.log $fn >$ba.err 2>&1 ## separate mode with filename extensions and .msg files #echo $val ../src/readpst $jobs -r -m -D -cv -o output$n -d $ba.log $fn @@ -135,6 +137,7 @@ #$func 28 pstsample.pst # character set issue #$func 29 pstsample2.pst # embedded image in rtf data #$func 30 pstsample3.pst # exports of rtf and html +$func 31 Journal_Archives_08_29_2010.pst [ -n "$val" ] && grep 'lost:' *err | grep -v 'lost: 0 ' diff -r 93a2d4b162e4 -r c5e7f13d2836 src/msg.cpp --- a/src/msg.cpp Wed Jun 12 21:34:35 2013 -0700 +++ b/src/msg.cpp Thu Jul 25 11:12:57 2013 -0700 @@ -381,8 +381,19 @@ GsfOutfile *out = GSF_OUTFILE (output); string_property(out, prop_list, 0x0FF90102, item->record_key); string_property(out, prop_list, 0x37010102, fp); - string_property(out, prop_list, 0x3704001E, body_charset, a->filename1); - string_property(out, prop_list, 0x3707001E, body_charset, a->filename2); + if (a->filename2.str) { + // have long file name + string_property(out, prop_list, 0x3707001E, body_charset, a->filename2); + } + else if (a->filename1.str) { + // have short file name + string_property(out, prop_list, 0x3704001E, body_charset, a->filename1); + } + else { + // make up a name + const char *n = "inline"; + string_property(out, prop_list, 0x3704001E, n, strlen(n)); + } string_property(out, prop_list, 0x370E001E, body_charset, a->mimetype); write_properties(out, prop_list, (const guint8*)&top_head, 8); // convenient 8 bytes of reserved zeros gsf_output_close(output);