Skip to content

Commit

Permalink
empty attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
Equationzhao committed May 31, 2024
1 parent bcd729a commit 4692c46
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions internal/content/extended.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@ package content
import (
"encoding/xml"
"fmt"
"github.com/valyala/bytebufferpool"

"github.com/Equationzhao/g/internal/global"
"github.com/Equationzhao/g/internal/item"
"github.com/Equationzhao/g/internal/render"
"github.com/pkg/xattr"
"github.com/valyala/bytebufferpool"
"howett.net/plist"
)

Expand All @@ -32,6 +31,10 @@ func formatBytes(bytes []byte) string {

// formatXattrValue attempts to parse the xattr value and returns a human-readable string.
func formatXattrValue(value []byte) string {
if len(value) == 0 {
return "<empty>"
}

// Check if the value is a binary plist
var plistData any
if _, err := plist.Unmarshal(value, &plistData); err == nil {
Expand Down

0 comments on commit 4692c46

Please sign in to comment.