Skip to content

[Patch] Extremely minor and hopefully straight forward: redundant test and indention #96

Open
@ZjYwMj

Description

@ZjYwMj

The following is extremely minor and straight forward. I hope it still deserves applying. And that the comments are sufficient.

--- a/src/lxterminal-0.4.0/src/lxterminal.c     2021-02-02 01:30:30.000000000 +0000
+++ b/src/lxterminal-0.4.0/src/lxterminal.c     2021-05-24 18:06:28.062788841 +0000
# https://developer.gnome.org/glib/unstable/glib-String-Utility-Functions.html#g-strfreev
# confirms there is no need to test if ptr != NULL.
@@ -1442,7 +1442,7 @@
          * The <rest of arguments> behavior is demanded by distros who insist on this xterm feature. */
         else if ((strcmp(argument, "--command") == 0) || (strcmp(argument, "-e") == 0))
         {
-            if(arguments->command != NULL) g_strfreev(arguments->command);
+            g_strfreev(arguments->command);
             cmd_len = 0;
             arguments->command = g_malloc(argc * sizeof(gchar *));
 
# Wrong idention 
@@ -1528,7 +1528,7 @@
         else {
             printf("%s\n", usage_display);
             return FALSE;
-    }
+        }
     }
     /* Handle --loginshell. */
     if (arguments->command != NULL && cmd_len <= 2) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions