📄 conf.c
字号:
#ifdef HAVE_CONFIG_H# include <config.h>#endif#include <stdio.h>#include <errno.h>#include <string.h>#include "extern.h"#ifndef LINE_MAX# define LINE_MAX 2048#endifintdisplay_file (const char *name, int code){ char *cp, line[LINE_MAX]; FILE *fp = fopen (name, "r"); if (fp != NULL) { while (fgets (line, sizeof(line), fp) != NULL) { cp = strchr (line, '\n'); if (cp != NULL) *cp = '\0'; lreply (code, "%s", line); } (void) fflush (stdout); (void) fclose (fp); return 0; } return errno;}/* Check if a user is in the file PATH_FTPUSERS return 1 if yes 0 otherwise. */intcheckuser (const char *filename, const char *name){ FILE *fp; int found = 0; char *p, line[BUFSIZ]; fp = fopen (filename, "r"); if (fp != NULL) { while (fgets (line, sizeof(line), fp) != NULL) { if (line[0] == '#') continue; p = strchr (line, '\n'); if (p != NULL) { *p = '\0'; if (strcmp (line, name) == 0) { found = 1; break; } } } (void) fclose (fp); } return (found);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -