nvim tabstop expandtab change

This commit is contained in:
Jonathan Wyss 2024-10-08 17:07:08 +02:00
parent 5a42f353dd
commit 61f8d67bb8

View File

@ -6,14 +6,14 @@
int loadConfig(char *str_file, char **str_entry,char **host,int *intervall,int size) int loadConfig(char *str_file, char **str_entry,char **host,int *intervall,int size)
{ {
int i=0; int i=0;
FILE *f_config; FILE *f_config;
char temp_str[256]; char temp_str[256];
char *ret = NULL; char *ret = NULL;
printf("\nopening config file\n"); printf("\nopening config file\n");
f_config = fopen(str_file,"r"); f_config = fopen(str_file,"r");
if(f_config != NULL) if(f_config != NULL)
{ {
ret = fgets(temp_str,256,f_config); ret = fgets(temp_str,256,f_config);
while(ret!=NULL) while(ret!=NULL)
{ {
@ -35,12 +35,12 @@ int loadConfig(char *str_file, char **str_entry,char **host,int *intervall,int s
ptr_host[strcspn(ptr_host,"\n")]=0; ptr_host[strcspn(ptr_host,"\n")]=0;
while(ptr_host[0]==' ') //Potential segfault?? while(ptr_host[0]==' ') //Potential segfault??
{ {
if(ptr_host < (temp_str + strlen(temp_str))) if(ptr_host < (temp_str + strlen(temp_str)))
{ {
ptr_host = ptr_host + 1; ptr_host = ptr_host + 1;
}else{ }else{
break; break;
} }
} }
*host = strdup(ptr_host); *host = strdup(ptr_host);
printf("my host is:%s\n",*host); printf("my host is:%s\n",*host);
@ -101,22 +101,22 @@ int loadConfig(char *str_file, char **str_entry,char **host,int *intervall,int s
}else{ }else{
ret = fgets(temp_str,256,f_config); ret = fgets(temp_str,256,f_config);
} }
} }
} }
else else
{ {
fprintf(stderr,"error opening file[%s]\n",str_file); fprintf(stderr,"error opening file[%s]\n",str_file);
} }
printf("Done reading config file\n"); printf("Done reading config file\n");
return 0; return 0;
} }
/*int parseConfig(File *file, char *str_entry) /*int parseConfig(File *file, char *str_entry)
{ {
char sub_str[256]; char sub_str[256];
if(strcmp(str_entry,"[Host]")==0)//section if(strcmp(str_entry,"[Host]")==0)//section
{ {
fgets(sub_str,256,file); fgets(sub_str,256,file);
//do sub parsing //do sub parsing
} }
}*/ }*/