Commit 8bc40adf authored by Vysheng's avatar Vysheng

Merge github.com:vysheng/tg

parents 725c6669 4b55f8f5
...@@ -10,6 +10,15 @@ Documentation for MTproto protocol is available here: http://core.telegram.org/m ...@@ -10,6 +10,15 @@ Documentation for MTproto protocol is available here: http://core.telegram.org/m
### Installation ### Installation
Clone GitHub Repository
$ git clone https://github.com/vysheng/tg.git && cd tg
or download and extrac zip
$ wget https://github.com/vysheng/tg/archive/master.zip -O tg-master.zip
$ tar xzf tg-master.zip && cd tg-master
#### Linux #### Linux
Just run Just run
......
...@@ -1118,7 +1118,7 @@ void add_log_event (const int *data, int len) { ...@@ -1118,7 +1118,7 @@ void add_log_event (const int *data, int len) {
int *end = in_end; int *end = in_end;
replay_log_event (); replay_log_event ();
if (rptr != wptr) { if (rptr != wptr) {
logprintf ("Unread %ld ints. Len = %d\n", wptr - rptr, len); logprintf ("Unread %lld ints. Len = %d\n", (long long)(wptr - rptr), len);
assert (rptr == wptr); assert (rptr == wptr);
} }
if (binlog_enabled) { if (binlog_enabled) {
......
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
#define sha1 SHA1 #define sha1 SHA1
#ifdef __APPLE__
#define OPEN_BIN "open %s"
#else
#define OPEN_BIN "xdg-open %s"
#endif
char *get_downloads_directory (void); char *get_downloads_directory (void);
int verbosity; int verbosity;
extern int offline_mode; extern int offline_mode;
...@@ -1755,7 +1761,7 @@ void end_load (struct download *D) { ...@@ -1755,7 +1761,7 @@ void end_load (struct download *D) {
logprintf ("Done: %s\n", D->name); logprintf ("Done: %s\n", D->name);
} else if (D->next == 2) { } else if (D->next == 2) {
static char buf[1000]; static char buf[1000];
sprintf (buf, "xdg-open %s", D->name); sprintf (buf, OPEN_BIN, D->name);
int x = system (buf); int x = system (buf);
if (x < 0) { if (x < 0) {
logprintf ("Can not open image viewer: %m\n"); logprintf ("Can not open image viewer: %m\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment