xaizek / pinfo (License: GPLv2 only) (since 2018-12-07)
Console-based info and manual pages reader, which adds interactive navigation to man pages.
Commit 850eccee0572e38521ec01a4728d83ecc5f3cc91

Fix a few compiler warnings
Author: bas@zoetekouw.net
Author date (UTC): 2017-08-09 10:22
Committer name: bas@zoetekouw.net
Committer date (UTC): 2017-08-09 13:07
Parent(s): ca3ab82e4e203f47f83a8bac79b6275bd8521f1d
Signing key:
Tree: 4fa8dea622e2d0c1662ed2e6db295051d12f7e70
File Lines added Lines deleted
src/common_includes.h 1 0
src/filehandling_functions.c 11 5
File src/common_includes.h changed (mode: 100644) (index 670a125..cf8e9b5)
37 37 #include <sys/stat.h> #include <sys/stat.h>
38 38 #include <pwd.h> #include <pwd.h>
39 39 #include <grp.h> #include <grp.h>
40 #include <assert.h>
40 41
41 42 #ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
42 43 #include "config.h" #include "config.h"
File src/filehandling_functions.c changed (mode: 100644) (index c1de709..5af253e)
... ... seeknode(int tag_table_pos, FILE ** Id)
1264 1264 void void
1265 1265 strip_compression_suffix(char *file) strip_compression_suffix(char *file)
1266 1266 { {
1267 const size_t len = strlen(file);
1268 assert(len<1024); /* just some random limit */
1267 1269 char *found = 0; char *found = 0;
1268 int j;
1269 for (j = 0; j < SuffixesNumber; j++)
1270
1271 for (unsigned j = 0; j < SuffixesNumber; j++)
1270 1272 { {
1271 1273 if ( (found = strstr(file, suffixes[j].suffix)) != NULL ) if ( (found = strstr(file, suffixes[j].suffix)) != NULL )
1272 1274 { {
1273 if ( (file + strlen(file)) - found == strlen(suffixes[j].suffix) )
1275 if ( file + len == found + strlen(suffixes[j].suffix) )
1274 1276 { {
1275 1277 *found = '\0'; *found = '\0';
1276 1278 break; break;
 
... ... strip_compression_suffix(char *file)
1283 1285 void void
1284 1286 strip_info_suffix(char *file) strip_info_suffix(char *file)
1285 1287 { {
1288 const size_t len = strlen(file);
1289 assert(len<1024); /* just some random limit */
1290
1286 1291 char *found = 0; char *found = 0;
1287 char suffix[6] = ".info";
1292 const char suffix[6] = ".info";
1293
1288 1294 if ( (found = strstr(file, suffix)) != NULL ) if ( (found = strstr(file, suffix)) != NULL )
1289 1295 { {
1290 if ( (file + strlen(file)) - found == strlen(suffix) )
1296 if ( file + len == found + strlen(suffix) )
1291 1297 { {
1292 1298 *found = '\0'; *found = '\0';
1293 1299 } }
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/pinfo

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/pinfo

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master