diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 18:43:43 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-10 18:43:43 -0500 |
commit | e60090bc9c7e14bb8253eeb64658aedaa0f863c7 (patch) | |
tree | 0d8b21f3ff848346d601c34c88bd35c76fb06d0a /mailnews/base/public | |
parent | 1ec388b2383aa1540961843847d3af32174a248d (diff) | |
download | UXP-e60090bc9c7e14bb8253eeb64658aedaa0f863c7.tar UXP-e60090bc9c7e14bb8253eeb64658aedaa0f863c7.tar.gz UXP-e60090bc9c7e14bb8253eeb64658aedaa0f863c7.tar.lz UXP-e60090bc9c7e14bb8253eeb64658aedaa0f863c7.tar.xz UXP-e60090bc9c7e14bb8253eeb64658aedaa0f863c7.zip |
Bug 1427732 - fix newline handling when copying messages and compacting folders.
Tag #1273
Diffstat (limited to 'mailnews/base/public')
-rw-r--r-- | mailnews/base/public/msgCore.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/mailnews/base/public/msgCore.h b/mailnews/base/public/msgCore.h index fc18fb16f..d14ff6140 100644 --- a/mailnews/base/public/msgCore.h +++ b/mailnews/base/public/msgCore.h @@ -178,6 +178,19 @@ NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_MAILNEWS, value) #define MSG_LINEBREAK_LEN 1 #endif +/* + * On Windows, we use \r\n as the line terminator in mbox files. On + * other platforms, we use \n. However, we need to be able to + * recognize line terminators produced on any platform, because we + * allow profiles (including the mbox files they contain) to be shared + * between platforms. + * + * Returns 0 (i.e., false) if the line is not blank, or otherwise the + * length of the line terminator, i.e., 1 for \n or 2 for \r\n. + */ +#define IS_MSG_LINEBREAK(line) \ + (line[0] == '\012' ? 1 : ((line[0] == '\015' && line[1] == '\012') ? 2 : 0)) + #define NS_MSG_BASE #define NS_MSG_BASE_STATIC_MEMBER_(type) type |