tab replaced with spaces
This commit is contained in:
parent
9c70da9ed7
commit
f773c0cf18
10
interface.c
10
interface.c
@ -115,11 +115,11 @@ char *command_generator (const char *text, int state) {
|
||||
index = -1;
|
||||
|
||||
rl_line_buffer[rl_point] = '\0'; /* the effect should be such
|
||||
* that the cursor position
|
||||
* is at the end of line for
|
||||
* the auto completion regex
|
||||
* above (note the $ at end)
|
||||
*/
|
||||
* that the cursor position
|
||||
* is at the end of line for
|
||||
* the auto completion regex
|
||||
* above (note the $ at end)
|
||||
*/
|
||||
|
||||
mode = get_complete_mode ();
|
||||
} else {
|
||||
|
30
loop.c
30
loop.c
@ -26,25 +26,25 @@ int main_loop (void) {
|
||||
FD_SET (0, &inp);
|
||||
tv.tv_sec = 1;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
|
||||
int lfd = 0;
|
||||
|
||||
if (select (lfd + 1, &inp, &outp, NULL, &tv) < 0) {
|
||||
if (errno == EINTR) {
|
||||
/* resuming from interrupt, so not an error situation,
|
||||
this generally happens when you suspend your
|
||||
messenger with "C-z" and then "fg". This is allowed "
|
||||
*/
|
||||
rl_reset_line_state ();
|
||||
rl_forced_update_display ();
|
||||
continue;
|
||||
}
|
||||
perror ("select()");
|
||||
break;
|
||||
/* resuming from interrupt, so not an error situation,
|
||||
this generally happens when you suspend your
|
||||
messenger with "C-z" and then "fg". This is allowed "
|
||||
*/
|
||||
rl_reset_line_state ();
|
||||
rl_forced_update_display ();
|
||||
continue;
|
||||
}
|
||||
perror ("select()");
|
||||
break;
|
||||
}
|
||||
|
||||
if (FD_ISSET (0, &inp)) {
|
||||
rl_callback_read_char ();
|
||||
rl_callback_read_char ();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@ -57,9 +57,9 @@ int loop (void) {
|
||||
if (!user && !auth_token) {
|
||||
printf ("Telephone number (with '+' sign): ");
|
||||
if (getline (&user, &size, stdin) == -1) {
|
||||
perror ("getline()");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
perror ("getline()");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
user[strlen (user) - 1] = '\0';
|
||||
set_default_username (user);
|
||||
}
|
||||
|
28
main.c
28
main.c
@ -93,7 +93,7 @@ char *get_config_directory (void) {
|
||||
|
||||
config_directory = (char *) calloc (length, sizeof (char));
|
||||
sprintf (config_directory, "%s/" CONFIG_DIRECTORY,
|
||||
get_home_directory ());
|
||||
get_home_directory ());
|
||||
|
||||
return config_directory;
|
||||
}
|
||||
@ -136,26 +136,26 @@ void running_for_first_time (void) {
|
||||
if (stat (config_filename, config_file_stat) != 0) {
|
||||
// config file missing, so touch it
|
||||
config_file_fd = open (config_filename, O_CREAT | O_RDWR, S_IRWXU);
|
||||
if (config_file_fd == -1) {
|
||||
perror ("open[config_file]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (config_file_fd == -1) {
|
||||
perror ("open[config_file]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (fchmod (config_file_fd, CONFIG_DIRECTORY_MODE) != 0) {
|
||||
perror ("fchmod[" CONFIG_FILE "]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
perror ("fchmod[" CONFIG_FILE "]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
if (write (config_file_fd, DEFAULT_CONFIG_CONTENTS, strlen (DEFAULT_CONFIG_CONTENTS)) <= 0) {
|
||||
perror ("write[config_file]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
perror ("write[config_file]");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
close (config_file_fd);
|
||||
printf ("[%s] created\n", config_filename);
|
||||
|
||||
/* create downloads directory */
|
||||
if (mkdir (downloads_directory, 0755) !=0) {
|
||||
perror ("creating download directory");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
perror ("creating download directory");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
}
|
||||
|
||||
set_setup_mode ();
|
||||
|
Loading…
x
Reference in New Issue
Block a user