summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
ddd596e)
This function returns strings so that the user can figure out the file's
correct encoding. @(#) has different interpretations in a few encodings
(sometimes 0x23 is not #) and there's no value in displaying different
versions of it, so skip it.
+static const char *
+skip_prefix (const char *s, const char *prefix)
+{
+ size_t prefix_len = strlen (prefix);
+ return !strncmp (s, prefix, prefix_len) ? s + prefix_len : s;
+}
+
/* Retrieves significant string data from R in its raw format, to allow the
caller to try to detect the encoding in use.
/* Retrieves significant string data from R in its raw format, to allow the
caller to try to detect the encoding in use.
add_string (&aux, r->header.creation_date, _("Creation Date"));
add_string (&aux, r->header.creation_time, _("Creation Time"));
add_string (&aux, r->header.creation_date, _("Creation Date"));
add_string (&aux, r->header.creation_time, _("Creation Time"));
- add_string (&aux, r->header.eye_catcher, _("Product"));
+ add_string (&aux, skip_prefix (r->header.eye_catcher, "@(#) "), _("Product"));
add_string (&aux, r->header.file_label, _("File Label"));
if (r->extensions[EXT_PRODUCT_INFO])
add_string (&aux, r->header.file_label, _("File Label"));
if (r->extensions[EXT_PRODUCT_INFO])