mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-12-22 14:30:29 +00:00
73ce022151
original makewhatis repository. Earlier versions of man, apropos, and whatis were by other authors (these are written from scratch). Catman is new.
30 lines
650 B
C
30 lines
650 B
C
/*
|
|
* Copyright 1995 by Devin Reade <gdr@myrias.com>. For distribution
|
|
* information see the README file that is part of the manpack archive,
|
|
* or contact the author, above.
|
|
*/
|
|
|
|
segment "common____";
|
|
|
|
#include <types.h>
|
|
#include <string.h>
|
|
#include "man.h"
|
|
|
|
/*
|
|
* getSuffixIndex
|
|
*
|
|
* return the index into compressArray of the appropriate
|
|
* suffix/decompresser. If there is no match, return -1.
|
|
*/
|
|
|
|
int getSuffixIndex(char *name) {
|
|
char *p;
|
|
int i;
|
|
|
|
for (i=0; compressArray[i].suffix != NULL; i++) {
|
|
p = strstr(name,compressArray[i].suffix);
|
|
if (p && !*(p + strlen(compressArray[i].suffix))) return i;
|
|
}
|
|
return -1;
|
|
}
|