summaryrefslogtreecommitdiff
path: root/libyelp
Commit message (Collapse)AuthorAgeFilesLines
* Handle mouse back/forward buttonsPaul Hebble2021-01-171-0/+22
|
* mallard-document: fix crash when reloading documentmcatanzaro/#122Michael Catanzaro2020-10-291-0/+1
| | | | | | | | | libxml memory management is quite uncleary, but I believe priv->cache has ownership of priv->mallard_ns, so the later is invalidated when the former is freed. We need to recreate it here. Reportedly fixes #122 for Shaun. (I was still seeing another crash, but it's probably a separate issue.)
* Fix crashes from setting automatic IDs in DocBook 5 documentsShaun McCance2020-10-281-12/+9
| | | | Fixes https://gitlab.gnome.org/GNOME/yelp/-/issues/148
* Fix links to search results for ghelp documentsShaun McCance2020-10-261-2/+6
| | | | Fixes https://gitlab.gnome.org/GNOME/yelp/-/issues/137
* Check against SOUP_URI_SCHEME_FILE instead of str comparisonShaun McCance2020-10-031-1/+1
|
* Don't mangle file: URIs for local HTML filesShaun McCance2020-10-031-1/+5
| | | | | | We do weird things to URIs to make WebKit happy. But if we're just looking at a local HTML file with a file: URI, WebKit is perfectly happy with the URI just the way it is. I hope.
* Remove deprecated method of doing private structs on gobjectsShaun McCance2020-03-0917-272/+261
|
* view: Enable WebKit back-forward swipe gestureAlexander Mikhaylenko2019-06-211-1/+5
| | | | | WebKitGTK supports back-forward navigation gesture since 2.23.90. Make use of it in Yelp.
* trivial: Plug memory leaksUmang Jain2019-03-292-0/+2
|
* Remove the unused encoding and language code from YelpManDocumentTomas Popela2019-01-211-75/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Error: UNUSED_VALUE (CWE-563): [#def25] yelp-3.28.1/libyelp/yelp-man-document.c:422: value_overwrite: Overwriting previous write to "encoding" with value from "langmap[i].encoding". yelp-3.28.1/libyelp/yelp-man-document.c:416: assigned_pointer: Assigning value from ""ISO-8859-1"" to "encoding" here, but that stored value is overwritten before it can be used. 414| encoding = g_getenv("MAN_ENCODING"); 415| if (encoding == NULL) 416|-> encoding = "ISO-8859-1"; 417| 418| if (language != NULL) { Error: CLANG_WARNING: [#def26] yelp-3.28.1/libyelp/yelp-man-document.c:416:2: warning: Value stored to 'encoding' is never read encoding = "ISO-8859-1"; ^ ~~~~~~~~~~~~ yelp-3.28.1/libyelp/yelp-man-document.c:416:2: note: Value stored to 'encoding' is never read encoding = "ISO-8859-1"; ^ ~~~~~~~~~~~~ 414| encoding = g_getenv("MAN_ENCODING"); 415| if (encoding == NULL) 416|-> encoding = "ISO-8859-1"; 417| 418| if (language != NULL) { Error: CLANG_WARNING: [#def27] yelp-3.28.1/libyelp/yelp-man-document.c:422:3: warning: Value stored to 'encoding' is never read encoding = langmap[i].encoding; ^ ~~~~~~~~~~~~~~~~~~~ yelp-3.28.1/libyelp/yelp-man-document.c:422:3: note: Value stored to 'encoding' is never read encoding = langmap[i].encoding; ^ ~~~~~~~~~~~~~~~~~~~ 420| for (i = 0; langmap[i].language != NULL; i++) { 421| if (g_str_equal (language, langmap[i].language)) { 422|-> encoding = langmap[i].encoding; 423| break; 424| }
* Remove unused variableTomas Popela2019-01-211-1/+0
| | | | | | | | | | | 4. yelp-3.28.1/libyelp/yelp-info-parser.c:959:2: note: Value stored to 'pages' is never read pages = 0; ^ ~ 957| (GDestroyNotify) gtk_tree_iter_free); 958| 959|-> pages = 0; 960| for (ptr = page_list; *ptr != NULL; ptr++) 961| {
* Check variable before dereferencing itTomas Popela2019-01-211-1/+1
| | | | | yelp-3.28.1/libyelp/yelp-mallard-document.c:341: var_compare_op: Comparing "path" to null implies that "path" might be null. yelp-3.28.1/libyelp/yelp-mallard-document.c:346: var_deref_op: Dereferencing null pointer "path".
* Check the strstr() return value before using itTomas Popela2019-01-211-3/+4
| | | | | | yelp-3.28.1/libyelp/yelp-uri-builder.c:81: returned_null: "strstr" returns null (checked 10 out of 12 times). yelp-3.28.1/libyelp/yelp-uri-builder.c:81: var_assigned: Assigning: "resource" = null return value from "strstr". yelp-3.28.1/libyelp/yelp-uri-builder.c:82: dereference: Incrementing a pointer which might be null: "resource".
* Swap the if() checks to avoid possible null pointer dereferenceTomas Popela2019-01-211-2/+2
| | | | | yelp-3.28.1/libyelp/yelp-transform.c:501: deref_ptr: Directly dereferencing pointer "ctxt". yelp-3.28.1/libyelp/yelp-transform.c:504: check_after_deref: Null-checking "ctxt" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
* Initialize ws_start variable before returning itTomas Popela2019-01-211-1/+1
| | | | | yelp-3.28.1/libyelp/yelp-man-parser.c:1194: var_decl: Declaring variable "ws_start" without initializer. yelp-3.28.1/libyelp/yelp-man-parser.c:1202: uninit_use: Using uninitialized value "ws_start".
* Increase the size of string variables passed to sscanfTomas Popela2019-01-211-2/+2
| | | | | | yelp-3.28.1/libyelp/yelp-man-parser.c:549: error[invalidScanfFormatWidth]: Width 10 given in format string (no. 2) is larger than destination buffer 'name[10]', use %9s to prevent overflowing it. yelp-3.28.1/libyelp/yelp-man-parser.c:926: error[invalidScanfFormatWidth]: Width 16 given in format string (no. 1) is larger than destination buffer 'name[16]', use %15s to prevent overflowing it.
* Avoid possible overrun while comparing to MAN_FONTSTomas Popela2019-01-211-2/+2
| | | | | | | | | yelp-3.28.1/libyelp/yelp-man-parser.c:464: cond_at_most: Checking "k > 8U" implies that "k" may be up to 8 on the false branch. yelp-3.28.1/libyelp/yelp-man-parser.c:469: overrun-local: Overrunning array "parser->font_registers" of 8 8-byte elements at element index 8 (byte offset 64) using index "k" (which evaluates to 8). yelp-3.28.1/libyelp/yelp-man-parser.c:476: assignment: Assigning: "k" = "parser->current_font". yelp-3.28.1/libyelp/yelp-man-parser.c:477: cond_at_most: Checking "k > 8U" implies that "k" and "parser->current_font" may be up to 8 on the false branch. yelp-3.28.1/libyelp/yelp-man-parser.c:477: overrun-local: Overrunning array "parser->font_registers" of 8 8-byte elements at element index 8 (byte offset 64) using index "k" (which evaluates to 8).
* Check whether parser is null before dereferencing itTomas Popela2019-01-211-4/+6
| | | | | yelp-3.28.1/libyelp/yelp-man-parser.c:445: var_compare_op: Comparing "parser" to null implies that "parser" might be null. yelp-3.28.1/libyelp/yelp-man-parser.c:449: var_deref_op: Dereferencing null pointer "parser".
* Check whether the index variable is valid before dereferencing itTomas Popela2019-01-211-2/+1
| | | | | yelp-3.28.1/libyelp/yelp-mallard-document.c:1002: deref_ptr: Directly dereferencing pointer "index". yelp-3.28.1/libyelp/yelp-mallard-document.c:1073: check_after_deref: Null-checking "index" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
* Fix a use of an uninitialized variableTomas Popela2019-01-211-1/+1
| | | | | | | | | | yelp-3.28.1/libyelp/yelp-info-parser.c:1174: var_decl: Declaring variable "menu_node" without initializer. yelp-3.28.1/libyelp/yelp-info-parser.c:1310: uninit_use: Using uninitialized value "menu_node". 1308| else if (*(menuitems[i]) != '\0') { 1309| tmp = g_strconcat ("\n", first_non_space (menuitems[i]), NULL); 1310|-> xmlNewTextChild (mholder ? mholder : menu_node, 1311| NULL, BAD_CAST "para1", 1312| BAD_CAST tmp);
* Check whether variable node is set before dereferencing itTomas Popela2019-01-211-2/+2
| | | | yelp-3.28.1/libyelp/yelp-info-parser.c:766: dereference: Dereferencing a pointer that might be null "node" when calling "strncmp".
* Check whether the index variable is valid before dereferencing itTomas Popela2019-01-211-5/+6
| | | | | | | | | | | yelp-3.28.1/libyelp/yelp-docbook-document.c:1058: check_after_deref: Null-checking "index" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. yelp-3.28.1/libyelp/yelp-docbook-document.c:1026: deref_ptr: Directly dereferencing pointer "index". yelp-3.28.1/libyelp/yelp-docbook-document.c:1054: deref_ptr: Directly dereferencing pointer "index". 1052| if (filename != NULL) 1053| g_free (filename); 1054|-> if (index->doc != NULL) 1055| xmlFreeDoc (index->doc); 1056| if (index->doc_uri != NULL)
* Check whether document has a root element before accessing itTomas Popela2019-01-211-2/+6
| | | | | | | | | | | | | | | | | | | | yelp-3.28.1/libyelp/yelp-docbook-document.c:562:13: note: Access to field 'ns' results in a dereference of a null pointer (loaded from field 'xmlcur') if (priv->xmlcur->ns) { ^ ~~~~~~ 560| * unique value, and insert it into the in-memory tree */ 561| g_snprintf (autoidstr, 20, "//autoid-%d", ++autoid); 562|-> if (priv->xmlcur->ns) { 563| xmlNewNsProp (priv->xmlcur, 564| xmlNewNs (priv->xmlcur, XML_XML_NAMESPACE, BAD_CAST "xml"), yelp-3.28.1/libyelp/yelp-docbook-document.c:608:16: note: Access to field 'children' results in a dereference of a null pointer (loaded from field 'xmlcur') for (cur = priv->xmlcur->children; cur; cur = cur->next) { ^ ~~~~~~ 606| NULL); 607| 608|-> for (cur = priv->xmlcur->children; cur; cur = cur->next) { 609| if (cur->type == XML_ELEMENT_NODE) { 610| priv->xmlcur = cur;
* Add G_GNUC_PRINTF attribute to yelp_debug()David King2019-01-211-1/+2
| | | | Silence a compiler warning.
* Support for keywords in search results for Mallard and DocBookShaun McCance2018-12-035-14/+172
|
* Fix build with GCC 8Michael Catanzaro2018-05-189-14/+14
| | | | | | Yelp enables -Werror by default, so it's responsible for predicting and fixing future compiler warnings that only an oracle could know about. In this case, that turned out to be -Werror=cast-function-type.
* Remove debug line I accidentally committedShaun McCance2018-02-191-1/+0
|
* view: Add a missing castMichael Catanzaro2017-12-121-1/+1
| | | | | This avoids triggering -Werror=incompatible-pointer-type after the g_object_ref/unref type propagation change.
* WebKit automatically updates font size on DPI change nowGabriel Ivascu2017-11-271-70/+2
| | | | | | This was introduced in WebKitGTK+ 2.19.2. https://bugzilla.gnome.org/show_bug.cgi?id=790728
* Fix namespace on internal Mallard cacheShaun McCance2017-10-021-10/+15
| | | | | Yelp has used the wrong namespace on the cache element since forever. yelp-xsl didn't care before. Now it does.
* Don’t translate propertiesPiotr Drąg2017-06-206-36/+36
| | | | | | They are not user-visible. https://bugzilla.gnome.org/show_bug.cgi?id=757496
* web-extension: Stop using unstable DOM API headersMichael Catanzaro2017-06-201-3/+1
| | | | | | | | | | | It's undesirable for Yelp to live on the edge, depending on API/ABI that can change at any time, without us noticing, without any WebKit soname bump. So the unstable API has been removed from WebKit. All API needed by Yelp is now stable. And there was much rejoicing in the streets! https://bugzilla.gnome.org/show_bug.cgi?id=773551
* magic-decompressor: Fix handling of uncompressed info pagesTing-Wei Lan2017-06-201-0/+2
| | | | | | | | | | When an uncompressed info page is specified, function yelp_magic_decompressor_convert always returns G_CONVERTER_CONVERTED. This causes file loading to never be completed because function g_input_stream_read keeps waiting for new data until the converter returns G_CONVERTER_FINISHED. https://bugzilla.gnome.org/show_bug.cgi?id=775603
* Fix a leak of a GFileInfoDavid King2017-06-191-0/+2
|
* document: add destroy notify to page callbackChristian Hergert2017-02-079-25/+53
| | | | | | | | | This ensures that we only free the async data struct when the document is guaranteed to be done calling our callback. Without this, we risk potentially accessing the async request data after we have freed it when a mallard document reloads. https://bugzilla.gnome.org/show_bug.cgi?id=778258
* view: initialize all struct members to NULLChristian Hergert2017-02-061-1/+1
| | | | resource_file was left uninitialized.
* print: use proper API to set print settingsChristian Hergert2017-02-061-2/+1
| | | | | | | WebKitPrintOperation is not a GtkPrintOperation so the cast here was invalid. This fixes <ctrl>p to show the print dialog. https://bugzilla.gnome.org/show_bug.cgi?id=778256
* settings: Fix GtkStyleContext warning spamMichael Catanzaro2016-03-011-4/+14
| | | | | | | This is happening in basically every application, due to implementation changes in GtkStyleContext https://bugzilla.gnome.org/show_bug.cgi?id=761577
* yelp-document: Fix return type of document_indexedMichael Catanzaro2016-02-061-2/+4
| | | | | | | | | It's a GSourceFunc, so it'd better return a gboolean. This doesn't seem to be causing any problems in Fedora, but in Endless it's causing 100% CPU usage after executing a search, because the source never gets removed. https://bugzilla.gnome.org/show_bug.cgi?id=761647
* Allow .docbook files as file path, #699995Shaun McCance2016-02-031-2/+3
|
* libyelp: fix handling of documents using local pathsCarlos Garcia Campos2016-01-142-104/+182
| | | | | | | | Since we switched to use custom URI schemes we no longer support loading file URIs. We need to detect the document pointed by the given URI and build an appropriate URI (ghelp, man, info, ...). https://bugzilla.gnome.org/show_bug.cgi?id=753443
* Convert libyelp subdirectory to non-recursive makeDavid King2015-10-232-198/+0
|
* Use dist_ prefix rather than EXTRA_DISTDavid King2015-10-201-5/+1
|
* Mark internal functions with G_GNUC_INTERNALDavid King2015-10-168-2/+15
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=756658
* Make yelp_info_parse_menu() staticDavid King2015-10-161-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=756658
* Remove unused yelp_marshal_VOID__OBJECT_BOXED()David King2015-10-161-1/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=756658
* Remove unused yelp_error_get_title()David King2015-10-162-8/+0
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=756658
* Link libyelp, not libyelpcommon, with libmDavid King2015-09-241-1/+2
|
* Fix linking error for undefined reference to hypotAndreas Henriksson2015-09-241-1/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=755489
* yelp-view: Do not initialize global settings in class_initCarlos Garcia Campos2015-09-211-10/+13
| | | | | | | | | Use a helper getter instead that creates the object on demand. Since the settings were created in class_init, we were always passing a NULL settings object to g_object_new in yelp_view_new(), so all settings set in the global settings were actually ignored. https://bugzilla.gnome.org/show_bug.cgi?id=754912