Fixed locale on MSVCRT compilation, e-mail fixes.

This commit is contained in:
Alexander S. Aganichev 2001-05-20 19:19:52 +00:00
parent a49b93dc74
commit 13b1a4fd12
8 changed files with 53 additions and 45 deletions

View File

@ -3,6 +3,7 @@
ifeq ($(findstring EMX, $(PATH)), EMX)
CC=gcc
AR=ar
RANLIB=ranlib
PLATFORM=emx
SHELL=bash
EXEEXT=.exe
@ -10,6 +11,7 @@ OBJEXT=.o
LIBEXT=.a
#CC=gcc -Zomf
#AR=emxomfar
#RANLIB=ranlib
#PLATFORM=emx
#SHELL=bash
#EXEEXT=.exe
@ -21,6 +23,7 @@ ifneq ($(DJGPP),)
CC=gcc
CXX=gpp
AR=ar
RANLIB=ranlib
PLATFORM=djg
SHELL=bash
EXEEXT=.exe
@ -31,6 +34,8 @@ ifeq ($(TERM),cygwin)
CC=gcc -mno-cygwin
CXX=g++ -mno-cygwin
AR=ar
RANLIB=ranlib
WINDRES=windres
PLATFORM=cyg
SHELL=bash
EXEEXT=.exe
@ -40,6 +45,7 @@ else
CC=gcc
CXX=g++
AR=ar
RANLIB=ranlib
PLATFORM=lnx
EXEEXT=
OBJEXT=.o

View File

@ -46,7 +46,7 @@ $(FOBJPATH)/%$(OBJEXT): %.c
ifeq ($(PLATFORM),cyg)
$(FOBJPATH)/%$(OBJEXT): %.rc
@echo creating resources
@windres -o $@ $<
@$(WINDRES) -o $@ $<
endif
ifeq ($(PLATFORM),emx)

View File

@ -7,5 +7,5 @@ $(TARGET): $(FLIBPATH)/lib$(TARGET)$(LIBEXT)
$(FLIBPATH)/lib$(TARGET)$(LIBEXT): $(OBJS)
@echo -n Creating library $(TARGET)...
@$(AR) cru $@ $(FOBJPATH)/*$(OBJEXT)
@ranlib $@
@$(RANLIB) $@
@echo done

View File

@ -12,6 +12,11 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
! A lot of manipulations with Internet addressing was done.
! GoldED+ now produce Internet addresses in RFC preferable form
"name" <email@address> instead of email@address (name).
+ Added ShowDeleted indicator to status line.
- Fixed few bugs in Undo feature.
@ -105,12 +110,6 @@ ______________________________________________________________________
+ You can explicitly select built-in template by defining "built-in".
! A lot of manipulations with Internet addressing was done. If at
least one person will be able to send message to expected
destination I'll be happy :-) If you'll find a bug please write me
a detailed guide (functional requirements specification :)) on how
everything should work.
! Fixed filelocking in UNIX version.
- Fixed "Via" kludge handling in JAM areas.

View File

@ -439,7 +439,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
sprintf(buf, "%sFrom: %s (%s)", rfc, msg->iorig, buf2);
sprintf(buf, "%sFrom: \"%s\" <%s>", rfc, buf2, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}
@ -512,7 +512,7 @@ void DoKludges(int mode, GMsg* msg, bool attronly) {
if(*msg->iorig) {
mime_header_encode(buf2, msg->By(), msg);
sprintf(buf, "%sSender: %s (%s)", rfc, msg->iorig, buf2);
sprintf(buf, "%sSender: \"%s\" <%s>", rfc, buf2, msg->iorig);
line = AddKludge(line, buf);
line->kludge = GKLUD_RFC;
}

View File

@ -147,32 +147,23 @@ bool set_to_address(GMsg* msg, gsetaddr* toname, gsetaddr* toaddr, gsetaddr* fro
ptr = strchr(buf1, '/');
if(ptr) {
*ptr++ = NUL;
strcpy(msg->idest, ptr);
strcpy(msg->realto, buf1+1);
if(*AA->Internetgate().name) {
strcpy(msg->iaddr, ptr);
ptr = strcpy(buf1, AA->Internetgate().name);
}
else
strcpy(buf1, ptr);
ParseInternetAddr(ptr, buf2, buf);
}
else {
strcpy(msg->idest, buf1+1);
if(*AA->Internetgate().name) {
strcpy(msg->iaddr, buf1+1);
ptr = strcpy(buf1, AA->Internetgate().name);
}
else {
strcpy(buf2, buf1+1);
ptr = strcpy(buf1, buf2);
}
ParseInternetAddr(buf1+1, buf2, buf);
}
strcpy(msg->realto, buf2);
strcpy(msg->idest, buf);
strcpy(msg->iaddr, buf);
if(ptr)
strcpy(buf2, buf1+1);
ptr = strcpy(buf1, ptr and *buf2 ? buf2 : *buf ? buf : buf2);
}
else if(AA->isinternet()) {
ParseInternetAddr(buf1, buf2, buf);
ptr = buf2;
strcpy(buf1, buf2);
strcpy(msg->realto, buf2);
strcpy(msg->idest, buf);
ptr = strcpy(buf1, *buf2 ? buf2 : buf);
}
else {
*msg->iaddr = NUL;
@ -453,17 +444,18 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
to_name = tmp_to_name;
if(AA->isinternet()) {
strcpy(msg->to, *AA->Internetgate().name ? AA->Internetgate().name : to_name.c_str());
strcpy(msg->to, *AA->Internetgate().name ? AA->Internetgate().name : msg->idest);
strcpy(msg->realby, msg->by);
strcpy(msg->realto, msg->to);
if(not *msg->realto and not strchr(msg->to, '@'))
strcpy(msg->realto, msg->to);
strcpy(msg->iorig, from_addr.c_str());
strcpy(msg->idest, to_addr.c_str());
if(*msg->by)
sprintf(msg->ifrom, "%s (%s)", msg->iorig, msg->by);
if(*msg->realby)
sprintf(msg->ifrom, "\"%s\" <%s>", msg->realby, msg->iorig);
else
sprintf(msg->ifrom, "%s", msg->iorig);
if(*msg->to)
sprintf(msg->ito, "%s (%s)", msg->idest, msg->to);
if(*msg->realto)
sprintf(msg->ito, "\"%s\" %s", msg->realto, msg->idest);
else
sprintf(msg->ito, "%s", msg->idest);
if(msg->orig.net == 0)
@ -474,6 +466,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
else {
if(strchr(to_name.c_str(), '@')) {
if(*AA->Internetgate().name) {
strcpy(msg->to, AA->Internetgate().name);
strcpy(msg->iaddr, to_name.c_str());
}
else {
@ -484,6 +477,8 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
else
strcpy(msg->to, to_name.c_str());
}
if(AA->Internetgate().addr.net)
msg->dest = AA->Internetgate().addr;
}
else
strcpy(msg->to, to_name.c_str());

View File

@ -49,16 +49,10 @@ extern "C" {
extern char tl[256], tu[256];
inline int _nls_tolower(int c) { return tl[c]; }
inline int _nls_toupper(int c) { return tu[c]; }
#ifdef __MSVCRT__
inline int _nls_isspace(int c) { return (iscntrl(c) or (c == ' ')); }
#endif
#ifdef __cplusplus
}
#define tolower(a) _nls_tolower((unsigned char)(a))
#define toupper(a) _nls_toupper((unsigned char)(a))
#ifdef __MSVCRT__
#define isspace(a) _nls_isspace((unsigned char)(a))
#endif
#endif
#endif

View File

@ -26,6 +26,8 @@
// Clipboard handling donated by Eugene Roshal
// ------------------------------------------------------------------
#include <clocale>
#include <cstdio>
#include <gstrall.h>
#include <gmemdbg.h>
#include <gutlos.h>
@ -133,20 +135,32 @@ int g_init_os(int flags) {
SetFileApisToOEM();
GetConsoleTitle(ge_win_coldtitle, sizeof(ge_win_coldtitle));
if(WinVer.dwPlatformId == VER_PLATFORM_WIN32_NT) {
#ifdef __MSVCRT__
char locale[256] = "";
char *lc = setlocale(LC_CTYPE, "");
if(lc) {
strxcpy(locale, lc, 256);
lc = strchr(locale, '.');
if(lc) {
sprintf(lc+1, "%u", GetOEMCP());
}
}
setlocale(LC_CTYPE, locale);
#endif
for(i = 0; i < 256; i++) {
#ifndef __MSVCRT__
tu[i] = (toupper)(i);
tl[i] = (tolower)(i);
#endif
if(i >= ' ') {
CHAR chr = (CHAR)i;
MultiByteToWideChar(CP_OEMCP, 0, &chr, 1, oem2unicode+i, 1);
}
}
#ifndef __MSVCRT__
return 0;
#endif
}
#ifdef __MSVCRT__
else
setlocale(LC_CTYPE, "C");
#endif
// Due to Win9x doesn't have proper locale support we should rebuild
// tolower/toupper tables
char src[2], dst[2];