fix some bugs

This commit is contained in:
NishiOwO 2025-03-18 15:04:38 +09:00
parent 47ce2e4754
commit 0439a51020
8 changed files with 25 additions and 12 deletions

View File

@ -3,7 +3,9 @@
# #
# Conversions for inline images # Conversions for inline images
inline application/postscript image/gif pstopxm gif8 %s inline application/postscript image/gif pstopnm %s | pnmquant 256 | pamtogif
inline image/png image/gif pngtopnm %s | pnmquant 256 | pamtogif
inline image/jpeg image/gif jpegtopnm %s | pnmquant 256 | pamtogif
# just do a download # just do a download
ftp application/x-compress * none ftp application/x-compress * none

View File

@ -64,6 +64,7 @@ audio/x-wav wav
image/gif gif image/gif gif
image/ief ief image/ief ief
image/jpeg jpeg jpg jpe image/jpeg jpeg jpg jpe
image/png png
image/tiff tiff tif image/tiff tiff tif
image/x-cmu-raster ras image/x-cmu-raster ras
image/x-portable-anymap pnm image/x-portable-anymap pnm

View File

@ -513,7 +513,14 @@ MIMEField *m;
*/ */
if (mystrncmp("content-type", field, 12) == 0) if (mystrncmp("content-type", field, 12) == 0)
{ {
int i;
d->content = alloc_string(data); d->content = alloc_string(data);
for(i = 0; d->content[i] != 0; i++){
if(d->content[i] == ';'){
d->content[i] = 0;
break;
}
}
} }
else if (mystrncmp("x-pcontent-type", field, 15) == 0) else if (mystrncmp("x-pcontent-type", field, 15) == 0)
{ {

View File

@ -358,11 +358,11 @@ void (*dfunc)();
NULL, 0); NULL, 0);
save = XtCreateManagedWidget("save", save = XtCreateManagedWidget("save",
scrollingTextWidgetClass, form, asciiTextWidgetClass, form,
NULL, 0); NULL, 0);
XtSetArg(args[0], XtNfromHoriz, label); XtSetArg(args[0], XtNfromHoriz, label);
XtSetValues(save, args, 1); XtSetValues(save, args, 1);
save = XtNameToWidget(save, "text"); /*save = XtNameToWidget(save, "text");*/
if (sdef == NULL) XtSetArg(args[0], XtNstring, ""); if (sdef == NULL) XtSetArg(args[0], XtNstring, "");
else XtSetArg(args[0], XtNstring, sdef); else XtSetArg(args[0], XtNstring, sdef);
XtSetArg(args[1], XtNeditType, XawtextEdit); XtSetArg(args[1], XtNeditType, XawtextEdit);
@ -384,11 +384,11 @@ void (*dfunc)();
NULL, 0); NULL, 0);
print = XtCreateManagedWidget("print", print = XtCreateManagedWidget("print",
scrollingTextWidgetClass, form, asciiTextWidgetClass, form,
NULL, 0); NULL, 0);
XtSetArg(args[0], XtNfromHoriz, label); XtSetArg(args[0], XtNfromHoriz, label);
XtSetValues(print, args, 1); XtSetValues(print, args, 1);
print = XtNameToWidget(print, "text"); /*print = XtNameToWidget(print, "text");*/
if (pdef == NULL) XtSetArg(args[0], XtNstring, ""); if (pdef == NULL) XtSetArg(args[0], XtNstring, "");
else XtSetArg(args[0], XtNstring, pdef); else XtSetArg(args[0], XtNstring, pdef);
XtSetArg(args[1], XtNeditType, XawtextEdit); XtSetArg(args[1], XtNeditType, XawtextEdit);
@ -410,11 +410,11 @@ void (*dfunc)();
NULL, 0); NULL, 0);
mail = XtCreateManagedWidget("mail", mail = XtCreateManagedWidget("mail",
scrollingTextWidgetClass, form, asciiTextWidgetClass, form,
NULL, 0); NULL, 0);
XtSetArg(args[0], XtNfromHoriz, label); XtSetArg(args[0], XtNfromHoriz, label);
XtSetValues(mail, args, 1); XtSetValues(mail, args, 1);
mail = XtNameToWidget(mail, "text"); /*mail = XtNameToWidget(mail, "text");*/
if (mdef == NULL) XtSetArg(args[0], XtNstring, ""); if (mdef == NULL) XtSetArg(args[0], XtNstring, "");
else XtSetArg(args[0], XtNstring, mdef); else XtSetArg(args[0], XtNstring, mdef);
XtSetArg(args[1], XtNeditType, XawtextEdit); XtSetArg(args[1], XtNeditType, XawtextEdit);

View File

@ -142,7 +142,7 @@ int s;
t = ReadBuffer(s, &tlen, 8, 8); t = ReadBuffer(s, &tlen, 8, 8);
if (t == NULL) return(NULL); if (t == NULL) return(NULL);
if (strncmp(t, "HTTP/1.0", 8) != 0) if (strncmp(t, "HTTP/1.0", 8) != 0 && strncmp(t, "HTTP/1.1", 8) != 0)
{ {
char *x; char *x;
int xlen; int xlen;

View File

@ -47,6 +47,7 @@ static MIMEType mhlist[] =
{ "image/jpeg", "jpg" }, { "image/jpeg", "jpg" },
{ "image/jpeg", "jpeg" }, { "image/jpeg", "jpeg" },
{ "image/tiff", "tiff" }, { "image/tiff", "tiff" },
{ "image/png", "png" },
{ "image/x-fits", "fit" }, { "image/x-fits", "fit" },
{ "image/x-fits", "fits" }, { "image/x-fits", "fits" },
{ "image/x-fits", "fts" }, { "image/x-fits", "fts" },

View File

@ -203,7 +203,7 @@ int inv; /* if 1 then text is invisible */
NULL, 0); NULL, 0);
field = XtCreateManagedWidget("field", field = XtCreateManagedWidget("field",
scrollingTextWidgetClass, form, asciiTextWidgetClass, form,
NULL, 0); NULL, 0);
if (inv) if (inv)
@ -214,7 +214,7 @@ int inv; /* if 1 then text is invisible */
XtSetArg(args[0], XtNfromVert, label); XtSetArg(args[0], XtNfromVert, label);
XtSetValues(field, args, 1); XtSetValues(field, args, 1);
field = XtNameToWidget(field, "text"); /* field = XtNameToWidget(field, "text");*/
if (sdef == NULL) XtSetArg(args[0], XtNstring, ""); if (sdef == NULL) XtSetArg(args[0], XtNstring, "");
else XtSetArg(args[0], XtNstring, sdef); else XtSetArg(args[0], XtNstring, sdef);
XtSetArg(args[1], XtNeditType, XawtextEdit); XtSetArg(args[1], XtNeditType, XawtextEdit);

View File

@ -549,6 +549,8 @@ RGBColor *bg;
if ((gifin_open_file() != GIFIN_SUCCESS) || /* read GIF header */ if ((gifin_open_file() != GIFIN_SUCCESS) || /* read GIF header */
(gifin_open_image() != GIFIN_SUCCESS)) { /* read image header */ (gifin_open_image() != GIFIN_SUCCESS)) { /* read image header */
file_open = 0;
image_open = 0;
return(NULL); return(NULL);
} }
image = newRGBImage(gifin_img_width, gifin_img_height, (gifin_l_cmap_flag ? image = newRGBImage(gifin_img_width, gifin_img_height, (gifin_l_cmap_flag ?