Skip to content

Commit

Permalink
CUPS will pass a / in the proposed filename where the original filena…
Browse files Browse the repository at this point in the history
…me on disk contains a : (which Finder displays as /)

So we need to replace the / with a :
  • Loading branch information
rodyager committed Jan 24, 2023
1 parent 68167e7 commit faa05a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdfwriter/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ if !FileManager.default.fileExists(atPath: outDir, isDirectory: &isDir) {
chown(outDir, passwd.pw_uid, passwd.pw_gid)
}

var fileName = (CommandLine.arguments[3] as NSString).deletingPathExtension
var fileName = (CommandLine.arguments[3].replacingOccurrences(of:"/", with: ":") as NSString).deletingPathExtension
if fileName == "(stdin)" {fileName = "Untitled" }

// make sure we have a unique filename
Expand Down

0 comments on commit faa05a5

Please sign in to comment.