9front - general discussion about 9front
 help / color / mirror / Atom feed
* upas/marshal fix extension parsing
@ 2019-11-22 11:27 kvik
  0 siblings, 0 replies; only message in thread
From: kvik @ 2019-11-22 11:27 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 431 bytes --]

While handling attachments upas/marshal first looks at the
file extension which it matches against a built-in list and
then against the system mimelist.

Both of those currently contain only single-component
extensions such as '.tgz' but marshal uses anything after the
first '.' in the name as an extension, probably in
anticipation for '.tar.gz' and similar.

This patch changes marshal to match the last '.' delimited
component.

[-- Attachment #2: Type: text/plain, Size: 344 bytes --]

diff -r 8b2040ba4785 sys/src/cmd/upas/marshal/marshal.c
--- a/sys/src/cmd/upas/marshal/marshal.c	Fri Nov 22 17:29:35 2019 +1030
+++ b/sys/src/cmd/upas/marshal/marshal.c	Fri Nov 22 11:59:56 2019 +0100
@@ -902,7 +902,7 @@
 	}
 
 	/* pick a type depending on extension */
-	p = strchr(file, '.');
+	p = strrchr(file, '.');
 	if(p != nil)
 		p++;
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-22 11:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-22 11:27 upas/marshal fix extension parsing kvik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).