mirror of
				https://github.com/Tha14/toxic.git
				synced 2025-10-31 03:06:51 +01:00 
			
		
		
		
	stderr redirect doesn't work as intended, add invalid command message when no sound
This commit is contained in:
		| @@ -168,7 +168,9 @@ void execute(WINDOW *w, ToxWindow *self, Tox *m, const char *input, int mode) | ||||
|     if (do_command(w, self, m, num_args, GLOBAL_NUM_COMMANDS, global_commands, args) == 0) | ||||
|         return; | ||||
|  | ||||
|     /* Just play sound instead */ | ||||
|     /*line_info_add(self, NULL, NULL, NULL, "Invalid command.", SYS_MSG, 0, 0);*/ | ||||
| #ifdef _SOUND_NOTIFY | ||||
|         sound_notify(self, error, 0, NULL); | ||||
| #else | ||||
|         line_info_add(self, NULL, NULL, NULL, SYS_MSG, 0, 0, "Invalid command."); | ||||
| #endif | ||||
| } | ||||
|   | ||||
| @@ -41,8 +41,6 @@ | ||||
|     #define PACKAGE_DATADIR "." | ||||
| #endif | ||||
|  | ||||
| #define NO_SOUND "silent" | ||||
|  | ||||
| const struct _ui_strings { | ||||
|     const char* self; | ||||
|     const char* timestamps; | ||||
|   | ||||
| @@ -23,6 +23,8 @@ | ||||
| #ifndef _settings_h | ||||
| #define _settings_h | ||||
|  | ||||
| #define NO_SOUND "silent" | ||||
|  | ||||
| /* holds user setting values */ | ||||
| struct user_settings { | ||||
|     int autolog;           /* boolean */ | ||||
|   | ||||
| @@ -705,12 +705,6 @@ int main(int argc, char *argv[]) | ||||
|     useconds_t msleepval = 40000; | ||||
|     uint64_t loopcount = 0; | ||||
|  | ||||
|      | ||||
|     /* Redirect stdout to /dev/null  | ||||
|      * NOTE: Might not be best solution | ||||
|      */ | ||||
|     freopen("/dev/null", "w", stderr); | ||||
|      | ||||
|     while (true) { | ||||
|         update_unix_time(); | ||||
|         do_toxic(m, prompt); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user