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 694089 Details for
Bug 615303
less fails to decompress empty files that have been gzipped
[?]
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]
Patch extracted from upstream less to fix the issue
less-436-empty-lessopen.patch (text/plain), 2.40 KB, created by
Martin Bříza
on 2013-02-06 18:33:15 UTC
(
hide
)
Description:
Patch extracted from upstream less to fix the issue
Filename:
MIME Type:
Creator:
Martin Bříza
Created:
2013-02-06 18:33:15 UTC
Size:
2.40 KB
patch
obsolete
>--- less-436/less.nro.empty-lessopen 2013-02-06 19:16:06.640490749 +0100 >+++ less-436/less.nro 2013-02-06 19:16:06.649490726 +0100 >@@ -1147,11 +1147,26 @@ lesspipe.sh: > .br > ;; > .br >+ *) exit 1 >+.br >+ ;; >+.br > esac > .br >+ exit $? >+.br > .PP > To use this script, put it where it can be executed and set > LESSOPEN="|lesspipe.sh %s". >+.PP >+The script should return zero if the output was valid and non-zero >+otherwise, so less could detect even a valid empty output >+(for example while uncompressing gzipped empty file). >+For backward-compatibility, this is not required by default. To turn >+this functionality there should be another vertical bar (|) straight >+after the first one in the LESSOPEN environment variable, eg. >+LESSOPEN="||lesspipe.sh %s". >+.PP > When an input pipe is used, a LESSCLOSE postprocessor can be used, > but it is usually not necessary since there is no replacement file > to clean up. >--- less-436/filename.c.empty-lessopen 2009-07-06 22:52:23.000000000 +0200 >+++ less-436/filename.c 2013-02-06 19:16:06.648490728 +0100 >@@ -843,6 +843,16 @@ open_altfile(filename, pf, pfd) > #else > lessopen++; > returnfd = 1; >+ >+ if (*lessopen == '|') { >+ /* >+ * If there is another vertical bar |, after >+ * the first one, it indicates a "pipe preprocessor" >+ * with correct exit status. >+ */ >+ lessopen++; >+ returnfd = 2; >+ } > #endif > } > if (*lessopen == '-') { >@@ -879,17 +889,39 @@ open_altfile(filename, pf, pfd) > */ > f = fileno(fd); > SET_BINARY(f); >+ *pfd = (void *) fd; >+ *pf = f; > if (read(f, &c, 1) != 1) > { > /* >- * Pipe is empty. This means there is no alt file. >+ * Error or pipe is empty. Close it and eventually >+ * check exit status of the pipe process. > */ >- pclose(fd); >+ *pf = 0; >+ *pfd = NULL; >+ if (pclose(fd) == 0 && returnfd == 2) { >+ /* >+ * Exit status was zero, so the EOF was correct empty output. >+ * Let the program open the archive again and seek to its end to >+ * be sure to get EOF. >+ * Quite ugly hack, to provide platform independency >+ */ >+ fd = fopen(filename, "rb"); >+ if (fd == NULL) >+ return (NULL); >+ int check_seek = fseek(fd, 0, SEEK_END); >+ if (check_seek != 0) >+ { >+ fclose(fd); >+ return (NULL); >+ } >+ *pf = fileno(fd); >+ *pfd = (void *) fd; >+ return (save(filename)); >+ } > return (NULL); > } > ch_ungetchar(c); >- *pfd = (void *) fd; >- *pf = f; > return (save("-")); > } > #endif
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 615303
:
467496
|
467503
|
514738
|
514739
| 694089