diff main.c @ 700:f3ec1cb11cea

Trim whitespace.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 17 Jan 2020 20:03:41 +0200
parents e9232ce52bf8
children 46efb0b16339
line wrap: on
line diff
--- a/main.c	Fri Jan 17 19:30:48 2020 +0200
+++ b/main.c	Fri Jan 17 20:03:41 2020 +0200
@@ -173,7 +173,7 @@
             rdata->desc,
             rdata->port);
     }
-    
+
     printf("\n");
 }
 
@@ -387,7 +387,7 @@
 
     if (str == NULL)
         return FALSE;
-    
+
     msg = th_strdup_printf("<USER>%s</USER><MESSAGE>%s</MESSAGE>", user, str);
 
     if (msg != NULL)
@@ -472,7 +472,7 @@
     char tmpStr[128];
     nn_window_t *tmpwin = (win != NULL) ? win : nnwin_main_window();
 
-    // Only the main window 
+    // Only the main window
     if (win == NULL && tmpwin != NULL && (flags & LOG_RECURSIVE) == 0)
     {
         time_t currTime = time(NULL);
@@ -632,7 +632,7 @@
 BOOL nn_check_name_list(th_llist_t *list, const char *name)
 {
     th_llist_t *node;
-    
+
     for (node = list; node != NULL; node = node->next)
     {
         if (th_strcasecmp(name, (char *) node->data) == 0)
@@ -658,7 +658,7 @@
     t = th_conn_buf_strstr(conn, "<MESSAGE>");
     if (!t) return 2;
     msg = conn->base.ptr;
-    
+
     t = th_conn_buf_strstr(conn, "</MESSAGE>");
     if (!t) return 3;
     *t = 0;
@@ -700,7 +700,7 @@
             nn_window_t *win;
             h = nn_decode_str2(t + 1);
 
-            // Check type of 
+            // Check type of
             if ((isMine = strncmp(t, "BPRV from ", 10)) == 0)
                 in_name = nn_decode_str2(t + 10);
             else
@@ -732,7 +732,7 @@
                         "½11½%s½0½\n", h);
                 }
             }
-            
+
             th_free(in_name);
             th_free(h);
         }
@@ -771,7 +771,7 @@
                colorText = 0;
            }
         }
-            
+
         printMsgF(NULL, isIgnored ? LOG_FILE : (LOG_WINDOW | LOG_FILE),
             "½5½<½%d½%s½5½>½%d½ %s½0½\n", colorNick, name, colorText, h);
         th_free(h);
@@ -969,7 +969,7 @@
                 // Newer method, supported by new-ish versions of Firefox
                 execlp(setBrowser, setBrowser, "-new-tab", uri, (void *)NULL);
                 break;
-            
+
             default:
                 // Default old method
                 {
@@ -1011,7 +1011,7 @@
     (void) conn;
 
     printMsg(currWin, "Opening profile for: '%s'\n", name);
-    
+
     nn_open_uri(uri);
 
     th_free(uri);
@@ -1225,7 +1225,7 @@
         color = 3;
 
     snprintf(name, sizeof(name), "[½%d½%-20s½0½] ", color, user->name);
-    
+
     d->total++;
     if (d->i >= NAME_NUM_PER_LINE)
     {
@@ -1233,7 +1233,7 @@
         d->i = 0;
         d->offs = 0;
     }
-    
+
     len = strlen(name);
     memcpy(d->buf + d->offs, name, len + 1);
     d->offs += len;
@@ -1396,7 +1396,7 @@
             char *nbuf;
             if (buf[cmd->len] != 0 && !th_isspace(buf[cmd->len]))
                 continue;
-            
+
             nbuf = str_trim_left(buf + cmd->len);
 
             switch (cmd->flags)
@@ -1409,7 +1409,7 @@
                         return 1;
                     }
                     break;
-                
+
                 case CMDARG_NONE:
                     if (nbuf[0])
                     {
@@ -1440,7 +1440,7 @@
             }
         }
     }
-    
+
     printMsgQ(currWin, "Unknown command: %s\n", buf);
     return 1;
 }
@@ -1467,7 +1467,7 @@
     if (list == NULL || pattern == NULL) return NULL;
 
     len = strlen(pattern);
-    
+
     if (current != NULL)
     {
         th_llist_t *node;
@@ -1548,13 +1548,13 @@
 static void nn_tabcomplete_replace(nn_editbuf_t *buf, size_t *pi, const size_t startPos, const size_t endPos, char *c)
 {
     size_t i;
-    
+
     for (i = startPos; i <= endPos; i++)
         nn_editbuf_delete(buf, startPos);
 
     for (i = startPos; *c; i++, c++)
         nn_editbuf_insert(buf, i, *c);
-    
+
     *pi = i;
 }
 
@@ -1790,7 +1790,7 @@
     case 0x09: // Tab = complete username or command
         nn_tabcomplete_buffer(editBuf);
         break;
-    
+
     default:
         return FALSE;
     }
@@ -1802,7 +1802,7 @@
 BOOL processUserPrompt(int c, nn_editbuf_t *editBuf, nn_editstate_t *editState)
 {
     (void) editBuf;
-    
+
     switch (c)
     {
     case KEY_ENTER:
@@ -1813,7 +1813,7 @@
         printMsg(currWin, "Quitting per user request (%d/0x%x).\n", c, c);
         appQuitFlag = TRUE;
         break;
-    
+
     default:
         return FALSE;
     }
@@ -1874,7 +1874,7 @@
         // PRV chat log
         size_t pos;
         char *cleaned;
-        
+
         if ((cleaned = th_strdup(win->id)) == NULL)
             return FALSE;
 
@@ -1889,7 +1889,7 @@
 
         th_free(cleaned);
     }
-    
+
     // Try to open the file for appending
     if (win->logFilename == NULL)
         goto error;
@@ -2200,7 +2200,7 @@
         errorMsg("Could not create connection structure.\n");
         goto err_exit;
     }
-    
+
     editState.conn = conn;
 
     // Are we using a proxy?
@@ -2265,7 +2265,7 @@
 
     // Initialize user commands
     nn_usercmd_init();
-    
+
     // Initialize random numbers
     editState.prevKeepAlive = time(NULL);
     srand((int) editState.prevKeepAlive);
@@ -2335,7 +2335,7 @@
                 colorSet = TRUE;
                 nn_conn_send_msg_v(conn, optUserNameEnc, "%%2FSetFontColor%%20%%2Dcolor%%20%06X", optUserColor);
             }
-            
+
             if (appCursesInit && !flushed)
             {
                 nnwin_update(FALSE, editState.mask, editBuf, optUserName, optUserColor);