Bug 203783 - editors/sublime3: Cannot open files when path contains space
Summary: editors/sublime3: Cannot open files when path contains space
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kubilay Kocak
URL:
Keywords: easy, needs-qa, patch
Depends on:
Blocks:
 
Reported: 2015-10-15 00:45 UTC by Anthony Eadicicco
Modified: 2015-11-18 03:10 UTC (History)
1 user (show)

See Also:
miguelmclara: maintainer-feedback+
koobs: merge-quarterly+


Attachments
fix wrapper script; use "$@" instead of $* (391 bytes, patch)
2015-10-15 13:55 UTC, miguelmclara
no flags Details | Diff
fix wrapper script; use "$@" instead of $* (1.40 KB, patch)
2015-10-19 13:07 UTC, miguelmclara
miguelmclara: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Eadicicco 2015-10-15 00:45:29 UTC
Sublime 3 contains a wrapper script at /usr/local/bin/sublime to ensure that /dev/shm is set up correctly, and it's currently passing arguments to the real binary incorrectly. The offending line:

/usr/local/share/sublime/sublime_text $*

This should read:

/usr/local/share/sublime/sublime_text "$@"

It currently causes sublime to incorrectly open any file where the path contains a space.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-15 05:44:33 UTC
Thanks for the report Anthony.

Can you provide a patch again editors/sublime3 in unified diff (svn diff or diff -u) format please

Also, should this change go upstream?
Comment 2 miguelmclara 2015-10-15 13:55:15 UTC
Created attachment 162070 [details]
fix wrapper script; use "$@" instead of $*
Comment 3 miguelmclara 2015-10-15 13:55:45 UTC
Its not a upstream issue, Its my bad, when adding the shm check to the wrapper script I didn't even noticed that.

But since files (or paths to files) can be passed as an argument it makes sense to use "$@" as you suggest.
 

I'll attach a patch, but many thanks for catching this.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-15 14:25:56 UTC
@miguel, please set maintainer-approval (to +) on the patch you would like committed

If you can manage QA results (portlint, poudriere) please also attach those.
Comment 5 miguelmclara 2015-10-19 13:07:34 UTC
Created attachment 162207 [details]
fix wrapper script; use "$@" instead of $*

while on this also fix portlint warn (un-sorted USES)



portlin output now:
WARN: Makefile: [45]: possible use of "${CHMOD}" found. Use @(owner,group,mode) syntax or @owner/@group operators in pkg-plist instead.
WARN: Makefile: Consider defining LICENSE.
0 fatal errors and 2 warnings found.
Comment 6 commit-hook freebsd_committer freebsd_triage 2015-10-20 04:26:30 UTC
A commit references this bug:

Author: koobs
Date: Tue Oct 20 04:25:45 UTC 2015
New revision: 399802
URL: https://svnweb.freebsd.org/changeset/ports/399802

Log:
  editors/sublime3: Fix opening filepaths with spaces

  Sublime 3 contains a wrapper script at /usr/local/bin/sublime to ensure that
  /dev/shm is set up correctly, and it's currently passing arguments to the
  real binary incorrectly.

  It currently causes sublime to incorrectly open any file where the path
  contains a space.

   - Modify sublime.in to open filepaths with spaces correctly
   - Bump PORTREVISION

  While I'm here:

   - Sort USES
   - Group USE{S} lines
   - Pet portlint (make patch `makepatch` compliant)

  PR:		203783
  Submitted by:	Miguel <miguelmclara gmail com> (maintainer)
  MFH:		2015Q4

Changes:
  head/editors/sublime3/Makefile
  head/editors/sublime3/files/patch-sublime_text.desktop
  head/editors/sublime3/files/sublime.in
Comment 7 commit-hook freebsd_committer freebsd_triage 2015-10-21 03:55:15 UTC
A commit references this bug:

Author: koobs
Date: Wed Oct 21 03:54:33 UTC 2015
New revision: 399886
URL: https://svnweb.freebsd.org/changeset/ports/399886

Log:
  MFH: r399802

  editors/sublime3: Fix opening filepaths with spaces

  Sublime 3 contains a wrapper script at /usr/local/bin/sublime to ensure that
  /dev/shm is set up correctly, and it's currently passing arguments to the
  real binary incorrectly.

  It currently causes sublime to incorrectly open any file where the path
  contains a space.

   - Modify sublime.in to open filepaths with spaces correctly
   - Bump PORTREVISION

  While I'm here:

   - Sort USES
   - Group USE{S} lines
   - Pet portlint (make patch `makepatch` compliant)

  PR:		203783
  Submitted by:	Miguel <miguelmclara gmail com> (maintainer)

  Approved by:	portmgr (bdrewery)

Changes:
_U  branches/2015Q4/
  branches/2015Q4/editors/sublime3/Makefile
  branches/2015Q4/editors/sublime3/files/patch-sublime_text.desktop
  branches/2015Q4/editors/sublime3/files/sublime.in
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-21 04:00:29 UTC
Committed and MFH'd to quarterly branch, thank you Anthony, Miguel!

I apologise this took so long. Please feel free to remind/bump/prod the project (within reason) until things get done, as sometimes things fall through the cracks.

Small, easy, non-contentious, obvious things like this shouldn't.