improvement: attachment feature
This commit is contained in:
		@@ -1,7 +1,8 @@
 | 
			
		||||
BEGIN                       { FS="[:;]" }
 | 
			
		||||
/^END:VEVENT$/              { ins = 0; exit }
 | 
			
		||||
/^[^ ]/ && a                { a = 0 }
 | 
			
		||||
/^ / && a                   { print substr($0, 2) }
 | 
			
		||||
/^ / && a && p              { print substr($0, 2); }
 | 
			
		||||
/^ / && a && !p             { if (index($0, ":")) { p = 1; print substr($0, index($0, ":")+1) } }
 | 
			
		||||
/^ATTACH/ && ins            { i++; }
 | 
			
		||||
/^ATTACH/ && ins && i == id { a = 1; print substr($0, index($0, ":")+1) }
 | 
			
		||||
/^ATTACH/ && ins && i == id { a = 1; if (index($0, ":")) { p = 1; print substr($0, index($0, ":")+1) } }
 | 
			
		||||
/^BEGIN:VEVENT$/            { ins = 1 }
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,6 @@ function cont_reading(str) {
 | 
			
		||||
function att_info(i, str,    cnt, k, info) {
 | 
			
		||||
  str = substr(str, 1, index(str, ":") - 1)
 | 
			
		||||
  cnt = split(str, props)
 | 
			
		||||
  info = "Attachment "i":"
 | 
			
		||||
  if (cnt > 1) {
 | 
			
		||||
    for (k=2; k<=cnt; k++) {
 | 
			
		||||
      pname = substr(props[k], 1, index(props[k], "=") - 1)
 | 
			
		||||
@@ -28,12 +27,8 @@ function att_info(i, str,    cnt, k, info) {
 | 
			
		||||
      if (pname == "FMTTYPE")
 | 
			
		||||
        type = pvalu
 | 
			
		||||
    }
 | 
			
		||||
    if (fin)
 | 
			
		||||
      info = info " \"" fin "\""
 | 
			
		||||
    if (type)
 | 
			
		||||
      info = info " " type
 | 
			
		||||
    if (enc)
 | 
			
		||||
      info = info " (inline)"
 | 
			
		||||
      info = "inline"
 | 
			
		||||
  }
 | 
			
		||||
  print i, fin, type, enc, info
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user