Modify ↓
#5796 closed defect (fixed)
Mime guessing doesn't work for shebang using /usr/bin/env
| Reported by: | Tim Hatch | Owned by: | Tim Hatch |
|---|---|---|---|
| Priority: | normal | Milestone: | 0.11 |
| Component: | general | Version: | devel |
| Severity: | normal | Keywords: | mimeview |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description
For files without an extension in the mime map, the guessing code looks for a line like
#!/usr/bin/python
This works great except for a lot of scripts these days (such as our own post commit hook) use
#!/usr/bin/env python
I propose making a reasonably trivial change to get_mimetype() that will make it recognize this syntax.
While I'm in there tweaking stuff, I'd also like to support some more vim-isms in modelines, such as filetype= and modelines near the bottom of the file (:help modelines reports that the first or last 5 are checked by default).
Thoughts?
Attachments (1)
Change History (3)
by , 18 years ago
| Attachment: | get_mimetype_r5883.diff added |
|---|
comment:2 by , 13 years ago
| Milestone: | → 0.11 |
|---|
Note:
See TracTickets
for help on using tickets.



Working version against r5883, for review