summaryrefslogtreecommitdiff
path: root/pico
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2017-11-20 23:24:58 -0700
committerEduardo Chappa <chappa@washington.edu>2017-11-20 23:24:58 -0700
commit570ada25db406ebe10d6aa454b4466fe47f34ff2 (patch)
treea7ac9f11de1490acfbce7f0ff7178da73cb79dad /pico
parent7fae026f633a89911e6be5bd2d7036a9face3557 (diff)
downloadalpine-570ada25db406ebe10d6aa454b4466fe47f34ff2.tar.xz
* Remove bell characted (\007) from status messages in Pico. This makes
it possible to translate them.
Diffstat (limited to 'pico')
-rw-r--r--pico/attach.c52
-rw-r--r--pico/browse.c62
-rw-r--r--pico/composer.c28
-rw-r--r--pico/display.c7
-rw-r--r--pico/efunc.h1
-rw-r--r--pico/file.c4
-rw-r--r--pico/fileio.c2
-rw-r--r--pico/osdep/altedit.c11
-rw-r--r--pico/osdep/filesys.c48
-rw-r--r--pico/osdep/getkey.c2
-rw-r--r--pico/osdep/spell.c2
-rw-r--r--pico/pico.c4
12 files changed, 118 insertions, 105 deletions
diff --git a/pico/attach.c b/pico/attach.c
index 09608d3..ebf0a4c 100644
--- a/pico/attach.c
+++ b/pico/attach.c
@@ -219,7 +219,7 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm)
if((new=(LMLIST *)malloc(sizeof(*new))) == NULL
|| (new->fname=malloc((len1+1) * sizeof(char))) == NULL
|| (new->dir=malloc((len2+1) * sizeof(char))) == NULL){
- emlwrite("\007Can't malloc space for filename", NULL);
+ emlwwrite(_("Can't malloc space for filename"), NULL);
return(-1);
}
@@ -257,7 +257,7 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm)
AttachCancel(fn);
pico_refresh(FALSE,1);
update();
- emlwrite("\007File name too BIG, cannot select!", NULL);
+ emlwwrite(_("File name too BIG, cannot select!"), NULL);
sleep(3);
}
}
@@ -268,7 +268,7 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm)
AttachCancel(fn);
pico_refresh(FALSE, 1);
update();
- emlwrite("\007File name too big, cannot select!", NULL);
+ emlwwrite(_("File name too big, cannot select!"), NULL);
sleep(3);
}
@@ -329,8 +329,8 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm)
fixpath(fn, sizeof(fn)); /* names relative to ~ */
if((gmode&MDTREE) && !in_oper_tree(fn)){
eml.s = (gmode&MDSCUR) ? _("home directory") : opertree;
- emlwrite(
- _("\007Restricted mode allows attachments from %s only"), &eml);
+ emlwwrite(
+ _("Restricted mode allows attachments from %s only"), &eml);
return(0);
}
}
@@ -343,7 +343,7 @@ AskAttach(char *cmnt, size_t cmntlen, LMLIST **lm)
len = strlen(fn);
if((new=(LMLIST *)malloc(sizeof(*new))) == NULL
|| (new->fname=malloc((len+1)*sizeof(char))) == NULL){
- emlwrite("\007Can't malloc space for filename", NULL);
+ emlwwrite(_("Can't malloc space for filename"), NULL);
return(-1);
}
@@ -383,7 +383,7 @@ AttachUpload(char *fn, size_t fnlen, char *sz, size_t szlen)
long l;
if(gmode&MDSCUR){
- emlwrite("\007Restricted mode disallows uploaded command", NULL);
+ emlwwrite(_("Restricted mode disallows uploaded command"), NULL);
return(0);
}
@@ -452,7 +452,7 @@ SyncAttach(void)
if(ki){
if((knwn = (PATMT **)malloc((ki+1) * (sizeof(PATMT *)))) == NULL){
eml.s = comatose(ki + 1);
- emlwrite("\007Can't allocate space for %s known attachment array entries",
+ emlwwrite(_("Can't allocate space for %s known attachment array entries"),
&eml);
rv = -1;
goto exit_early;
@@ -475,7 +475,7 @@ SyncAttach(void)
if((bld = (PATMT **)malloc(nbld * (sizeof(PATMT *)))) == NULL){
eml.s = comatose(nbld);
- emlwrite("\007Can't allocate space for %s build array entries", &eml);
+ emlwwrite(_("Can't allocate space for %s build array entries"), &eml);
rv = -1;
goto exit_early;
}
@@ -488,7 +488,7 @@ SyncAttach(void)
if(bi == nbld){ /* need to grow build array? */
if((bld = (PATMT **)realloc(bld, ++nbld * sizeof(PATMT *))) == NULL){
eml.s = comatose(nbld);
- emlwrite("\007Can't resize build array to %s entries ", &eml);
+ emlwwrite(_("Can't resize build array to %s entries"), &eml);
rv = -1;
goto exit_early;
}
@@ -536,7 +536,7 @@ SyncAttach(void)
if((j=strlen(file)) > strlen(tp->filename)){
if((tp->filename = (char *)realloc(tp->filename,
sizeof(char)*(j+1))) == NULL){
- emlwrite("\007Can't realloc filename space",NULL);
+ emlwwrite(_("Can't realloc filename space"),NULL);
rv = -1;
goto exit_early;
}
@@ -550,7 +550,7 @@ SyncAttach(void)
if((j=strlen(size)) > strlen(tp->size)){
if((tp->size=(char *)realloc(tp->size,
sizeof(char)*(j+1))) == NULL){
- emlwrite("\007Can't realloc space for size", NULL);
+ emlwwrite(_("Can't realloc space for size"), NULL);
rv = -1;
goto exit_early;
}
@@ -565,7 +565,7 @@ SyncAttach(void)
if((j=strlen(comment)) > strlen(tp->description)){
if((tp->description=(char *)realloc(tp->description,
sizeof(char)*(j+1))) == NULL){
- emlwrite("\007Can't realloc description", NULL);
+ emlwwrite(_("Can't realloc description"), NULL);
rv = -1;
goto exit_early;
}
@@ -848,7 +848,7 @@ ParseAttach(struct hdr_line **lp, /* current header line */
the %s is replaced with the character that is not
allowed in the name. */
eml.s = (c == ',') ? "," : "space";
- emlwrite(_("\007Attchmnt: '%s' not allowed in file name"), &eml);
+ emlwwrite(_("Attchmnt: '%s' not allowed in file name"), &eml);
rv = -1;
level = TG; /* eat rest of garbage */
break;
@@ -902,7 +902,7 @@ process_tag: /* enclosed in [] */
if((gmode & MDTREE) && !in_oper_tree(fn)){
eml.s = (gmode&MDSCUR) ? _("home directory") : opertree;
- emlwrite(_("\007Attachments allowed only from %s"), &eml);
+ emlwwrite(_("Attachments allowed only from %s"), &eml);
rv = -1;
level = TG;
break;
@@ -948,7 +948,7 @@ process_tag: /* enclosed in [] */
rv = 1;
}
else{
- emlwrite("\007Attchmnt: Problem displaying real file path", NULL);
+ emlwwrite(_("Attchmnt: Problem displaying real file path"), NULL);
}
}
@@ -972,7 +972,7 @@ process_tag: /* enclosed in [] */
if(c != ']'){ /* legit label? */
eml.s = fn;
- emlwrite(_("\007Attchmnt: Expected ']' after \"%s\""),
+ emlwwrite(_("Attchmnt: Expected ']' after \"%s\""),
&eml);
rv = -1;
level = TG;
@@ -1001,7 +1001,7 @@ process_tag: /* enclosed in [] */
if(tp == NULL){
eml.s = fn;
- emlwrite("\007Attchmnt: Unknown reference: %s", &eml);
+ emlwwrite(_("Attchmnt: Unknown reference: %s"), &eml);
lblsz = "XXX";
}
}
@@ -1050,7 +1050,7 @@ process_tag: /* enclosed in [] */
eml.s = c == ',' ? ","
: c == ' ' ? "space"
: c == '[' ? "[" : "]";
- emlwrite(_("\007Attchmnt: '%s' not allowed in file name"), &eml);
+ emlwwrite(_("Attchmnt: '%s' not allowed in file name"), &eml);
rv = -1; /* bad char in file name */
level = TG; /* gobble garbage */
}
@@ -1093,7 +1093,7 @@ process_tag: /* enclosed in [] */
}
else{
eml.s = fn;
- emlwrite(_("\007Attchmnt: Expected '(' or '\"' after %s"), &eml);
+ emlwwrite(_("Attchmnt: Expected '(' or '\"' after %s"), &eml);
rv = -1; /* bag it all */
level = TG;
}
@@ -1152,7 +1152,7 @@ process_tag: /* enclosed in [] */
*p = '\0';
utf8 = ucs4_to_utf8_cpystr(tmp);
eml.s = utf8;
- emlwrite(_("\007Attchmnt: Size field missing ')': \"%s\""), &eml);
+ emlwwrite(_("Attchmnt: Size field missing ')': \"%s\""), &eml);
if(utf8)
fs_give((void **) &utf8);
@@ -1171,7 +1171,7 @@ process_tag: /* enclosed in [] */
lbln = 0; /* reset flag */
}
else if(c != '\"' && c != '\0'){
- emlwrite(_("\007Attchmnt: Malformed comment, quotes required"), NULL);
+ emlwwrite(_("Attchmnt: Malformed comment, quotes required"), NULL);
rv = -1;
level = TG;
}
@@ -1193,7 +1193,7 @@ process_tag: /* enclosed in [] */
cmnt[cmntlen-1] = '\0';
fs_give((void **) &utf8);
if(c == '\0'){
- emlwrite(_("\007Attchmnt: Closing quote required at end of comment"), NULL);
+ emlwwrite(_("Attchmnt: Closing quote required at end of comment"), NULL);
rv = -1;
}
}
@@ -1237,14 +1237,14 @@ process_tag: /* enclosed in [] */
break;
default:
if(rv != -1)
- emlwrite(_("\007Attchmnt: Comma must separate attachments"), NULL);
+ emlwwrite(_("Attchmnt: Comma must separate attachments"), NULL);
rv = -1;
}
}
break;
default: /* something's very wrong */
- emlwrite("\007Attchmnt: Weirdness in ParseAttach", NULL);
+ emlwwrite(_("Attchmnt: Weirdness in ParseAttach"), NULL);
return(-1); /* just give up */
}
@@ -1497,7 +1497,7 @@ sinserts(UCS *ds, /* dest string */
*ds++ = *ss++;
}
else
- emlwrite("\007No end of line???", NULL); /* can this happen? */
+ emlwwrite(_("No end of line???"), NULL); /* can this happen? */
}
else{ /* dest is longer, shrink it */
j = dl - sl; /* difference in lengths */
diff --git a/pico/browse.c b/pico/browse.c
index 2869e8c..c64b2e5 100644
--- a/pico/browse.c
+++ b/pico/browse.c
@@ -331,7 +331,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(dir)){
eml.s = opertree;
- emlwrite(_("\007Can't read outside of %s in restricted mode"), &eml);
+ emlwwrite(_("Can't read outside of %s in restricted mode"), &eml);
sleep(2);
return(0);
}
@@ -748,7 +748,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
case 'X':
if(!(gmp->flags & FB_LMODE)){
if(gmp->flags & FB_LMODEPOS)
- emlwrite(_("\007Type L command to use ListMode"), NULL);
+ emlwwrite(_("Type L command to use ListMode"), NULL);
else
unknown_command(c);
@@ -756,7 +756,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
}
if(gmp->current->mode == FIODIR){
- emlwrite(_("\007Can't Set directories"), NULL);
+ emlwwrite(_("Can't Set directories"), NULL);
break;
}
@@ -777,7 +777,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
* Unless we make it so you can get out of ListMode
* once you're in ListMode, this must be an error.
*/
- emlwrite(_("\007Already in ListMode"), NULL);
+ emlwwrite(_("Already in ListMode"), NULL);
break;
}
else{
@@ -818,7 +818,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
tmp, NLINE, QNORML, opts);
switch(status){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -857,7 +857,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
case 'D':
if(gmp->current->mode == FIODIR){
/* BUG: if dir is empty it should be deleted */
- emlwrite(_("\007Can't delete a directory"), NULL);
+ emlwwrite(_("Can't delete a directory"), NULL);
break;
}
@@ -984,7 +984,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
switch(status){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -1017,7 +1017,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(child)){
eml.s = opertree;
- emlwrite(_("\007 Can't go outside of %s in restricted mode"),
+ emlwwrite(_("Can't go outside of %s in restricted mode"),
&eml);
break;
}
@@ -1035,7 +1035,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
}
else{
eml.s = child;
- emlwrite(_("\007Not a directory: \"%s\""), &eml);
+ emlwwrite(_("Not a directory: \"%s\""), &eml);
}
break;
@@ -1074,7 +1074,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
switch(status=mlreply_utf8(add_file ? _("Name of file to add: ") : _("Name of directory to add: "), child, NLINE,
QFFILE, opts)){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -1111,7 +1111,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(child)){
eml.s = opertree;
- emlwrite(_("\007Restricted mode allows Add in %s only"),
+ emlwwrite(_("Restricted mode allows Add in %s only"),
&eml);
break;
}
@@ -1196,7 +1196,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
case 'c': /* copy */
case 'C':
if(gmp->current->mode == FIODIR){
- emlwrite(_("\007Can't copy a directory"), NULL);
+ emlwwrite(_("Can't copy a directory"), NULL);
break;
}
@@ -1213,7 +1213,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
switch(status=mlreply_utf8(_("Name of new copy: "), child, NLINE,
QFFILE, NULL)){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -1237,7 +1237,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
}
if(!strcmp(gmp->current->fname, child)){
- emlwrite(_("\007Can't copy file on to itself!"), NULL);
+ emlwwrite(_("Can't copy file on to itself!"), NULL);
break;
}
@@ -1248,7 +1248,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(child)){
eml.s = opertree;
- emlwrite(_("\007Restricted mode allows Copy in %s only"),
+ emlwwrite(_("Restricted mode allows Copy in %s only"),
&eml);
break;
}
@@ -1324,7 +1324,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
i = 0;
if(!strcmp(gmp->current->fname, "..")){
- emlwrite(_("\007Can't rename \"..\""), NULL);
+ emlwwrite(_("Can't rename \"..\""), NULL);
break;
}
@@ -1341,7 +1341,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
switch(status=mlreply_utf8(_("Rename file to: "), child, NLINE, QFFILE,
NULL)){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -1368,7 +1368,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(child)){
eml.s = opertree;
- emlwrite(_("\007Restricted mode allows Rename in %s only"),
+ emlwwrite(_("Restricted mode allows Rename in %s only"),
&eml);
break;
}
@@ -1454,8 +1454,8 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((gmode&MDTREE) && !in_oper_tree(tmp)){
eml.s = PARENTDIR;
- emlwrite(
- _("\007Can't visit %s in restricted mode"),
+ emlwwrite(
+ _("Can't visit %s in restricted mode"),
&eml);
break;
}
@@ -1482,7 +1482,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
}
#endif
else{
- emlwrite(_("\007Can't move up a directory"),
+ emlwwrite(_("Can't move up a directory"),
NULL);
break;
}
@@ -1530,7 +1530,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
}
else{
eml.s = child;
- emlwrite(_("\007Problem finding dir \"%s\""), &eml);
+ emlwwrite(_("Problem finding dir \"%s\""), &eml);
}
}
@@ -1585,7 +1585,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
if((new=(LMLIST *)malloc(sizeof(*new))) == NULL
|| (new->fname=malloc(gmp->current->fname ? (flen=strlen(gmp->current->fname))+1 : 1)) == NULL
|| (new->dir=malloc((dlen=strlen(gmp->dname))+1)) == NULL){
- emlwrite("\007Can't malloc space for filename", NULL);
+ emlwwrite(_("Can't malloc space for filename"), NULL);
return(-1);
}
@@ -1634,7 +1634,7 @@ FileBrowse(char *dir, size_t dirlen, char *fn, size_t fnlen,
while(!i){
switch(readpattern(_("File name to find"), FALSE, flags)){
case HELPCH:
- emlwrite(_("\007No help yet!"), NULL);
+ emlwwrite(_("No help yet!"), NULL);
/* remove break and sleep after help text is installed */
sleep(3);
break;
@@ -1793,7 +1793,7 @@ getfcells(char *dname, int fb_flags)
errbuf[0] = '\0';
if((mp=(struct bmaster *)malloc(sizeof(struct bmaster))) == NULL){
- emlwrite("\007Can't malloc space for master filename cell", NULL);
+ emlwwrite(_("Can't malloc space for master filename cell"), NULL);
return(NULL);
}
@@ -1828,7 +1828,7 @@ getfcells(char *dname, int fb_flags)
if((mp->names = getfnames(mp->dname, NULL, &nentries, errbuf, sizeof(errbuf))) == NULL){
free((char *) mp);
if(*errbuf)
- emlwrite(errbuf, NULL);
+ emlwwrite(errbuf, NULL);
return(NULL);
}
@@ -1842,7 +1842,7 @@ getfcells(char *dname, int fb_flags)
* easily be made a user option later on...
*/
if((filtnames=(char **)malloc((nentries+1) * sizeof(char *))) == NULL){
- emlwrite("\007Can't malloc space for name array", NULL);
+ emlwwrite(_("Can't malloc space for name array"), NULL);
zotmaster(&mp);
return(NULL);
}
@@ -1897,7 +1897,7 @@ getfcells(char *dname, int fb_flags)
while(nentries--){ /* stat filtered files */
/* get a new cell */
if((ncp=(struct fcell *)malloc(sizeof(struct fcell))) == NULL){
- emlwrite("\007Can't malloc cells for browser!", NULL);
+ emlwwrite(_("Can't malloc cells for browser!"), NULL);
zotfcells(mp->head); /* clean up cells */
free((char *) filtnames);
free((char *) mp);
@@ -1928,7 +1928,7 @@ getfcells(char *dname, int fb_flags)
}
else{
if((tmpstr = (char *)malloc((flength+1)*sizeof(char))) == NULL){
- emlwrite("\007Can't malloc cells for temp buffer!", NULL);
+ emlwwrite(_("Can't malloc cells for temp buffer!"), NULL);
zotfcells(mp->head); /* clean up cells */
free((char *) filtnames);
free((char *) mp);
@@ -2026,7 +2026,7 @@ add_cell_to_lmlist(struct fcell *cell, struct bmaster *mp)
if((new=(LMLIST *)malloc(sizeof(*new))) == NULL ||
(new->fname=malloc(sizeof(char)*((flen=strlen(cell->fname))+1))) == NULL ||
(new->dir=malloc(sizeof(char)*((dlen=strlen(mp->dname))+1))) == NULL){
- emlwrite("\007Can't malloc space for filename", NULL);
+ emlwwrite(_("Can't malloc space for filename"), NULL);
return;
}
@@ -2377,7 +2377,7 @@ PlaceCell(struct bmaster *mp, struct fcell *cp, int *x, int *y)
if((tp = tp->next) == NULL){ /* above top? */
if(secondtry++){
- emlwrite("\007Internal error: can't find fname cell", NULL);
+ emlwwrite(_("Internal error: can't find fname cell"), NULL);
return(-1);
}
else{
diff --git a/pico/composer.c b/pico/composer.c
index 3a01dae..1bcb258 100644
--- a/pico/composer.c
+++ b/pico/composer.c
@@ -265,7 +265,7 @@ InitMailHeader(PICO *mp)
if(strlen(addrbuf) + strlen(buf) >= addrbuflen){
addrbuflen += NLINE * 4;
if(!(addrbuf = (char *)realloc(addrbuf, addrbuflen))){
- emlwrite("\007Can't realloc addrbuf to %d bytes",
+ emlwwrite(_("Can't realloc addrbuf to %d bytes"),
(void *) addrbuflen);
return(ABORT);
}
@@ -756,7 +756,7 @@ HeaderEditor(int f, int n)
if(FormatLines(headents[ods.cur_e].hd_text, "",
term.t_ncol - headents[ods.cur_e].prwid,
headents[ods.cur_e].break_on_comma, 0) == -1)
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
UpdateHeader(0);
PaintHeader(COMPOSER_TOP_LINE, FALSE);
PaintBody(1);
@@ -808,7 +808,7 @@ HeaderEditor(int f, int n)
space = len+3;
bfp = malloc(space*sizeof(char));
if(bfp == NULL){
- emlwrite("\007Can't malloc space for filename",
+ emlwwrite(_("Can't malloc space for filename"),
NULL);
continue;
}
@@ -1004,7 +1004,7 @@ HeaderEditor(int f, int n)
if(insert && FormatLines(ods.cur_l, insert,
term.t_ncol - headents[ods.cur_e].prwid,
headents[ods.cur_e].break_on_comma,0)==-1){
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
}
if(insert)
@@ -1293,7 +1293,7 @@ nomore_to_complete:
space = len+3;
bfp = malloc(space*sizeof(char));
if(bfp == NULL){
- emlwrite("\007Can't malloc space for filename",
+ emlwwrite(_("Can't malloc space for filename"),
NULL);
continue;
}
@@ -1317,7 +1317,7 @@ nomore_to_complete:
if(FormatLines(headents[ods.cur_e].hd_text, bfp,
term.t_ncol - headents[ods.cur_e].prwid,
headents[ods.cur_e].break_on_comma,0)==-1){
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
}
if(bfp != buf)
@@ -1651,7 +1651,7 @@ header_downline(int beyond, int gripe)
if(FormatLines(headents[ods.cur_e].hd_text, "",
term.t_ncol-headents[new_e].prwid,
headents[ods.cur_e].break_on_comma, 0) == -1)
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
}
} else if(headents[ods.cur_e].builder) { /* expand addresses */
int mangled = 0;
@@ -1753,7 +1753,7 @@ header_upline(int gripe)
if(FormatLines(headents[ods.cur_e].hd_text, "",
term.t_ncol - headents[ods.cur_e].prwid,
headents[ods.cur_e].break_on_comma,0) == -1)
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
}
}
else if(headents[ods.cur_e].builder){
@@ -1837,7 +1837,7 @@ AppendAttachment(char *fn, char *sz, char *cmt)
lp = lp->next;
}
else{
- emlwrite("\007Can't allocate line for new attachment!", NULL);
+ emlwwrite(_("Can't allocate line for new attachment!"), NULL);
return(0);
}
}
@@ -1860,13 +1860,13 @@ AppendAttachment(char *fn, char *sz, char *cmt)
if(status < 0){
eml.s = fn;
- emlwrite("\007Problem attaching: %s", &eml);
+ emlwwrite(_("Problem attaching: %s"), &eml);
}
if(FormatLines(headents[a_e].hd_text, "",
term.t_ncol - headents[a_e].prwid,
headents[a_e].break_on_comma, 0) == -1){
- emlwrite("\007Format lines failed!", NULL);
+ emlwwrite(_("Format lines failed!"), NULL);
return(0);
}
}
@@ -2023,7 +2023,7 @@ LineEdit(int allowedit, UCS *lastch)
*/
if(allowedit){
if(headents[ods.cur_e].is_attach && intag(strng,ods.p_ind)){
- emlwrite(_("\007Can't edit attachment number!"), NULL);
+ emlwwrite(_("Can't edit attachment number!"), NULL);
continue;
}
@@ -2245,7 +2245,7 @@ LineEdit(int allowedit, UCS *lastch)
continue;
if(headents[ods.cur_e].is_attach && intag(strng, ods.p_ind)){
- emlwrite(_("\007Can't edit attachment number!"), NULL);
+ emlwwrite(_("Can't edit attachment number!"), NULL);
continue;
}
@@ -2259,7 +2259,7 @@ LineEdit(int allowedit, UCS *lastch)
}
if(headents[ods.cur_e].is_attach && intag(strng, ods.p_ind-1)){
- emlwrite(_("\007Can't edit attachment number!"), NULL);
+ emlwwrite(_("Can't edit attachment number!"), NULL);
continue;
}
diff --git a/pico/display.c b/pico/display.c
index 0afc358..6ac9666 100644
--- a/pico/display.c
+++ b/pico/display.c
@@ -2380,6 +2380,13 @@ ret:
void
+emlwwrite(char *utf8message, EML *eml)
+{
+ (*term.t_beep)();
+ emlwrite(utf8message, eml);
+}
+
+void
emlwrite(char *utf8message, EML *eml)
{
UCS *message;
diff --git a/pico/efunc.h b/pico/efunc.h
index 59e5342..2e6e049 100644
--- a/pico/efunc.h
+++ b/pico/efunc.h
@@ -134,6 +134,7 @@ extern int mlreplyd_utf8(char *, char *, int, int, EXTRAKEYS *);
extern int mlreplyd(UCS *, UCS *, int, int, EXTRAKEYS *);
extern int mlwrite_utf8(char *, void *);
extern int mlwrite(UCS *, void *);
+extern void emlwwrite(char *, EML *);
extern void emlwrite(char *, EML *);
extern void emlwrite_ucs4(UCS *, EML *);
extern void unknown_command(UCS);
diff --git a/pico/file.c b/pico/file.c
index 26cb34e..73b9d16 100644
--- a/pico/file.c
+++ b/pico/file.c
@@ -304,8 +304,8 @@ insfile(int f, int n)
char tfname[NLINE];
if(gmode&MDSCUR){
- emlwrite(
- _("\007Restricted mode disallows uploaded command"),
+ emlwwrite(
+ _("Restricted mode disallows uploaded command"),
NULL);
return(0);
}
diff --git a/pico/fileio.c b/pico/fileio.c
index 91eacf9..f0a3ddc 100644
--- a/pico/fileio.c
+++ b/pico/fileio.c
@@ -73,7 +73,7 @@ ffputline(CELL buf[], int nbuf)
if(ferror(g_pico_fio.fp)){
eml.s = errstr(errno);
- emlwrite("\007Write error: %s", &eml);
+ emlwwrite(_("Write error: %s"), &eml);
sleep(5);
return FIOERR;
}
diff --git a/pico/osdep/altedit.c b/pico/osdep/altedit.c
index f722413..4a8f8db 100644
--- a/pico/osdep/altedit.c
+++ b/pico/osdep/altedit.c
@@ -74,7 +74,7 @@ alt_editor(int f, int n)
char *fn; /* tmp holder for file name */
char result[128]; /* result string */
char prmpt[128];
- int i, done = 0, ret = 0, rv, trv;
+ int i, done = 0, ret = 0, rv, trv, beep;
pid_t child, pid;
RETSIGTYPE (*ohup)(int);
RETSIGTYPE (*oint)(int);
@@ -82,6 +82,7 @@ alt_editor(int f, int n)
int status;
EML eml;
+ beep = 0;
eml.s = f ? "speller" : "editor";
if(gmode&MDSCUR){
@@ -288,7 +289,8 @@ alt_editor(int f, int n)
exit(-1);
}
else { /* error! */
- snprintf(result, sizeof(result), "\007Can't fork %%s: %s", errstr(errno));
+ snprintf(result, sizeof(result), _("Can't fork %%s: %s"), errstr(errno));
+ beep = 1;
ret = -1;
}
@@ -334,7 +336,10 @@ alt_editor(int f, int n)
ttopen(); /* reset the signals */
pico_refresh(0, 1); /* redraw */
update();
- emlwrite(result, &eml);
+ if(beep)
+ emlwwrite(result, &eml);
+ else
+ emlwrite(result, &eml);
return(ret);
#else /* _WINDOWS */
char eb[2 * PATH_MAX]; /* buf holding edit command */
diff --git a/pico/osdep/filesys.c b/pico/osdep/filesys.c
index 8796fec..c69cde1 100644
--- a/pico/osdep/filesys.c
+++ b/pico/osdep/filesys.c
@@ -299,19 +299,19 @@ getfnames(char *dn, char *pat, int *n, char *e, size_t elen)
switch(errno){
case ENOENT : /* File not found */
if(e)
- snprintf(e, elen, "\007File not found: \"%s\"", dn);
+ snprintf(e, elen, _("File not found: \"%s\""), dn);
break;
#ifdef ENAMETOOLONG
case ENAMETOOLONG : /* Name is too long */
if(e)
- snprintf(e, elen, "\007File name too long: \"%s\"", dn);
+ snprintf(e, elen, _("File name too long: \"%s\""), dn);
break;
#endif
default: /* Some other error */
if(e)
- snprintf(e, elen, "\007Error getting file info: \"%s\"", dn);
+ snprintf(e, elen, _("Error getting file info: \"%s\""), dn);
break;
}
@@ -325,7 +325,7 @@ getfnames(char *dn, char *pat, int *n, char *e, size_t elen)
avail = alloced = MAX(sbuf.st_size, incr);
if((sbuf.st_mode&S_IFMT) != S_IFDIR){
if(e)
- snprintf(e, elen, "\007Not a directory: \"%s\"", dn);
+ snprintf(e, elen, _("Not a directory: \"%s\""), dn);
return(NULL);
}
@@ -333,7 +333,7 @@ getfnames(char *dn, char *pat, int *n, char *e, size_t elen)
if((names=(char *)malloc(alloced * sizeof(char))) == NULL){
if(e)
- snprintf(e, elen, "\007Can't malloc space for file names");
+ snprintf(e, elen, _("Can't malloc space for file names"));
return(NULL);
}
@@ -342,7 +342,7 @@ getfnames(char *dn, char *pat, int *n, char *e, size_t elen)
errno = 0;
if((dirp=opendir(fname_to_locale(dn))) == NULL){
if(e)
- snprintf(e, elen, "\007Can't open \"%s\": %s", dn, errstr(errno));
+ snprintf(e, elen, _("Can't open \"%s\": %s"), dn, errstr(errno));
free((char *)names);
return(NULL);
@@ -398,7 +398,7 @@ getfnames(char *dn, char *pat, int *n, char *e, size_t elen)
if((names=(char *)realloc((void *)names, alloced * sizeof(char)))
== NULL){
if(e)
- snprintf(e, elen, "\007Can't malloc enough space for file names");
+ snprintf(e, elen, _("Can't malloc enough space for file names"));
return(NULL);
}
@@ -440,31 +440,31 @@ fioperr(int e, char *f)
switch(e){
case FIOFNF: /* File not found */
- emlwrite("\007File \"%s\" not found", &eml);
+ emlwwrite(_("File \"%s\" not found"), &eml);
break;
case FIOEOF: /* end of file */
- emlwrite("\007End of file \"%s\" reached", &eml);
+ emlwwrite(_("End of file \"%s\" reached"), &eml);
break;
case FIOLNG: /* name too long */
- emlwrite("\007File name \"%s\" too long", &eml);
+ emlwwrite(_("File name \"%s\" too long"), &eml);
break;
case FIODIR: /* file is a directory */
- emlwrite("\007File \"%s\" is a directory", &eml);
+ emlwwrite(_("File \"%s\" is a directory"), &eml);
break;
case FIONWT:
- emlwrite("\007Write permission denied: %s", &eml);
+ emlwwrite(_("Write permission denied: %s"), &eml);
break;
case FIONRD:
- emlwrite("\007Read permission denied: %s", &eml);
+ emlwwrite(_("Read permission denied: %s"), &eml);
break;
case FIOPER:
- emlwrite("\007Permission denied: %s", &eml);
+ emlwwrite(_("Permission denied: %s"), &eml);
break;
case FIONEX:
- emlwrite("\007Execute permission denied: %s", &eml);
+ emlwwrite(_("Execute permission denied: %s"), &eml);
break;
default:
- emlwrite("\007File I/O error: %s", &eml);
+ emlwwrite(_("File I/O error: %s"), &eml);
}
}
@@ -787,13 +787,13 @@ copy(char *a, char *b)
if(!(fsb.st_mode&S_IREAD)){ /* can we read it? */
eml.s = a;
- emlwrite("\007Read permission denied: %s", &eml);
+ emlwwrite(_("Read permission denied: %s"), &eml);
return(-1);
}
if((fsb.st_mode&S_IFMT) == S_IFDIR){ /* is it a directory? */
eml.s = a;
- emlwrite("\007Can't copy: %s is a directory", &eml);
+ emlwwrite(_("Can't copy: %s is a directory"), &eml);
return(-1);
}
@@ -803,25 +803,25 @@ copy(char *a, char *b)
break; /* these are OK */
default:
eml.s = errstr(errno);
- emlwrite("\007Can't Copy: %s", &eml);
+ emlwwrite(_("Can't Copy: %s"), &eml);
return(-1);
}
}
else{
if(!(tsb.st_mode&S_IWRITE)){ /* can we write it? */
eml.s = b;
- emlwrite("\007Write permission denied: %s", &eml);
+ emlwwrite(_("Write permission denied: %s"), &eml);
return(-1);
}
if((tsb.st_mode&S_IFMT) == S_IFDIR){ /* is it directory? */
eml.s = b;
- emlwrite("\007Can't copy: %s is a directory", &eml);
+ emlwwrite(_("Can't copy: %s is a directory"), &eml);
return(-1);
}
if(fsb.st_dev == tsb.st_dev && fsb.st_ino == tsb.st_ino){
- emlwrite("\007Identical files. File not copied", NULL);
+ emlwwrite(_("Identical files. File not copied"), NULL);
return(-1);
}
}
@@ -939,13 +939,13 @@ ffclose(void)
|| ftruncate(fileno(g_pico_fio.fp),
(off_t) ftell(g_pico_fio.fp)) < 0)){
eml.s = errstr(errno);
- emlwrite("\007Error preparing to close file: %s", &eml);
+ emlwwrite(_("Error preparing to close file: %s"), &eml);
sleep(5);
}
if (fclose(g_pico_fio.fp) == EOF) {
eml.s = errstr(errno);
- emlwrite("\007Error closing file: %s", &eml);
+ emlwwrite(_("Error closing file: %s"), &eml);
return(FIOERR);
}
#else /* _WINDOWS */
diff --git a/pico/osdep/getkey.c b/pico/osdep/getkey.c
index e2a9d7b..0f10cb4 100644
--- a/pico/osdep/getkey.c
+++ b/pico/osdep/getkey.c
@@ -109,7 +109,7 @@ ReadyForKey(int timeout)
case BAIL_OUT:
case PANIC_NOW:
- emlwrite("\007Problem reading from keyboard!", NULL);
+ emlwwrite(_("Problem reading from keyboard!"), NULL);
kill(getpid(), SIGHUP); /* Bomb out (saving our work)! */
/* no return */
}
diff --git a/pico/osdep/spell.c b/pico/osdep/spell.c
index f05446b..0ff6ed8 100644
--- a/pico/osdep/spell.c
+++ b/pico/osdep/spell.c
@@ -142,7 +142,7 @@ spell(int f, int n)
if(ret != FIOSUC){
eml.s = sp;
- emlwrite(_("\007Spell-checking file \"%s\" not found"), &eml);
+ emlwwrite(_("Spell-checking file \"%s\" not found"), &eml);
return(-1);
}
diff --git a/pico/pico.c b/pico/pico.c
index 9056853..118a3be 100644
--- a/pico/pico.c
+++ b/pico/pico.c
@@ -705,7 +705,7 @@ abort_composer(int f, int n)
return(TRUE);
case ABORT:
- emlwrite(_("\007Cancel Cancelled"), NULL);
+ emlwwrite(_("Cancel Cancelled"), NULL);
break;
default:
@@ -746,7 +746,7 @@ wquit(int f, int n)
/* First, make sure there are no outstanding problems */
if(AttachError()){
- emlwrite(_("\007Problem with attachments! Fix errors or delete attachments."), NULL);
+ emlwwrite(_("Problem with attachments! Fix errors or delete attachments."), NULL);
return(FALSE);
}