Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 602646 Details for
Bug 797784
file doesn't read patterns from $HOME/.magic.mgc file
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
proposed patch
file-5.11-magicmgc-home.patch (text/plain), 945 bytes, created by
Jan Kaluža
on 2012-08-07 05:56:04 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
Jan Kaluža
Created:
2012-08-07 05:56:04 UTC
Size:
945 bytes
patch
obsolete
>diff --git a/src/magic.c b/src/magic.c >index 7eb0441..d8c5835 100644 >--- a/src/magic.c >+++ b/src/magic.c >@@ -101,16 +101,20 @@ get_default_magic(void) > if ((home = getenv("HOME")) == NULL) > return MAGIC; > >- if (asprintf(&hmagicpath, "%s/.magic", home) < 0) >+ if (asprintf(&hmagicpath, "%s/.magic.mgc", home) < 0) > return MAGIC; >- if (stat(hmagicpath, &st) == -1) >- goto out; >- if (S_ISDIR(st.st_mode)) { >- free(hmagicpath); >- if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0) >+ if (stat(hmagicpath, &st) == -1) { >+ if (asprintf(&hmagicpath, "%s/.magic", home) < 0) > return MAGIC; >- if (access(hmagicpath, R_OK) == -1) >+ if (stat(hmagicpath, &st) == -1) > goto out; >+ if (S_ISDIR(st.st_mode)) { >+ free(hmagicpath); >+ if (asprintf(&hmagicpath, "%s/%s", home, hmagic) < 0) >+ return MAGIC; >+ if (access(hmagicpath, R_OK) == -1) >+ goto out; >+ } > } > > if (asprintf(&default_magic, "%s:%s", hmagicpath, MAGIC) < 0)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 797784
: 602646