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 582276 Details for
Bug 818807
evince-thumbnailer loops indefinitely on XPS 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.
Test program
xpstest.c (text/plain), 2.39 KB, created by
Tom Hughes
on 2012-05-05 10:34:27 UTC
(
hide
)
Description:
Test program
Filename:
MIME Type:
Creator:
Tom Hughes
Created:
2012-05-05 10:34:27 UTC
Size:
2.39 KB
patch
obsolete
>#include <errno.h> >#include <fcntl.h> >#include <stdio.h> >#include <stdlib.h> >#include <string.h> > >#include "archive.h" >#include "archive_entry.h" > >typedef struct { > const char *name; > int fd; > int error; > char buffer[4096]; >} xps_context_t; > >static int xps_open(struct archive *archive, void *data) >{ > xps_context_t *context = data; > > if ( ( context->fd = open( context->name, O_RDONLY ) ) < 0 ) > { > context->error = errno; > } > > return context->error ? ARCHIVE_FATAL : ARCHIVE_OK; >} > >static ssize_t xps_read(struct archive *archive, void *data, const void **buffer) >{ > xps_context_t *context = data; > int bytes; > > *buffer = context->buffer; > > if ( ( bytes = read( context->fd, context->buffer, sizeof( context->buffer ) ) ) < 0 ) > { > context->error = errno; > } > > return bytes; >} > >static off_t xps_skip(struct archive *archive, void *data, off_t request) >{ > xps_context_t *context = data; > > if ( lseek( context->fd, request, SEEK_CUR ) < 0 ) > { > context->error = errno; > request = 0; > } > > return request; >} > >static int xps_close(struct archive *archive, void *data) >{ > xps_context_t *context = data; > > close( context->fd ); > context->fd = -1; > > return ARCHIVE_OK; >} > >int main(int argc, char **argv) >{ > xps_context_t context; > struct archive *archive; > int result = ARCHIVE_OK; > > context.name = "engine-codes.xps"; > context.fd = -1; > context.error = 0; > > archive = archive_read_new(); > archive_read_support_format_zip( archive ); > archive_read_open2( archive, &context, xps_open, xps_read, xps_skip, xps_close ); > > if ( context.error ) > { > fprintf( stderr, "Error: %s\n", strerror( context.error ) ); > exit( 1 ); > } > > while ( result != ARCHIVE_FATAL && result != ARCHIVE_EOF ) > { > struct archive_entry *entry; > > result = archive_read_next_header( archive, &entry ); > > if ( result >= ARCHIVE_WARN && result <= ARCHIVE_OK ) > { > if ( result < ARCHIVE_OK ) > { > fprintf( stderr, "Error: %s\n", archive_error_string( archive ) ); > archive_set_error( archive, ARCHIVE_OK, "No error" ); > archive_clear_error( archive ); > } > > printf( "%s\n", archive_entry_pathname( entry ) ); > > archive_read_data_skip( archive ); > } > } > > if ( result == ARCHIVE_FATAL ) > { > fprintf( stderr, "Error: %s\n", archive_error_string( archive ) ); > } > > exit( 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 Raw
Actions:
View
Attachments on
bug 818807
:
582020
| 582276