]> git.ipfire.org Git - thirdparty/sarg.git/blobdiff - sort.c
Add support to decompress xz files
[thirdparty/sarg.git] / sort.c
diff --git a/sort.c b/sort.c
index 7b6426d032936bbea6d3fc040955bcaa6a91f442..f2802d438191080e4fc3e14d4b6dcb4070ad05f4 100644 (file)
--- a/sort.c
+++ b/sort.c
@@ -63,32 +63,32 @@ void tmpsort(const struct userinfostruct *uinfo)
                order="-r";
 
        if (snprintf(arqin,sizeof(arqin),"%s/%s.utmp",tmp,uinfo->filename)>=sizeof(arqin)) {
-               debuga(_("Path too long: "));
+               debuga(__FILE__,__LINE__,_("Path too long: "));
                debuga_more("%s/%s.utmp\n",tmp,uinfo->filename);
                exit(EXIT_FAILURE);
        }
        if (snprintf(arqou,sizeof(arqou),"%s/htmlrel.txt",tmp)>=sizeof(arqou)) {
-               debuga(_("Path too long: "));
+               debuga(__FILE__,__LINE__,_("Path too long: "));
                debuga_more("%s/htmlrel.txt\n",tmp);
                exit(EXIT_FAILURE);
        }
 
        if(debug) {
-               debuga(_("Sorting file: %s\n"),arqin);
+               debuga(__FILE__,__LINE__,_("Sorting file \"%s\"\n"),arqin);
        }
 
        if (snprintf(csort,sizeof(csort),"sort -n -T \"%s\" -t \"\t\" %s -k %s -k %s -k %s -o \"%s\" \"%s\"",tmp,order,field1,field2,field3,arqou,arqin)>=sizeof(csort)) {
-               debuga(_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),arqin,arqou);
+               debuga(__FILE__,__LINE__,_("Sort command too long when sorting file \"%s\" to \"%s\"\n"),arqin,arqou);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
        if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
-               debuga(_("sort command return status %d\n"),WEXITSTATUS(cstatus));
-               debuga(_("sort command: %s\n"),csort);
+               debuga(__FILE__,__LINE__,_("sort command return status %d\n"),WEXITSTATUS(cstatus));
+               debuga(__FILE__,__LINE__,_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
        if (!KeepTempLog && unlink(arqin)) {
-               debuga(_("Cannot delete \"%s\": %s\n"),arqin,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),arqin,strerror(errno));
                exit(EXIT_FAILURE);
        }
 
@@ -117,7 +117,8 @@ void sort_users_log(const char *tmp, int debug,struct userinfostruct *uinfo)
        int clen;
 
        if(debug) {
-               debuga(_("Sorting log %s/%s.user_unsort\n"),tmp,uinfo->filename);
+               snprintf(csort,sizeof(csort),"%s/%s.user_unsort",tmp,uinfo->filename);
+               debuga(__FILE__,__LINE__,_("Sorting file \"%s\"\n"),csort);
        }
 
        user=uinfo->filename;
@@ -125,24 +126,24 @@ void sort_users_log(const char *tmp, int debug,struct userinfostruct *uinfo)
                        tmp, tmp, user, tmp, user);
        if (clen>=sizeof(csort)) {
                /* TRANSLATORS: The message is followed by the command that is too long. */
-               debuga(_("User name too long to sort with command "));
+               debuga(__FILE__,__LINE__,_("User name too long to sort with command "));
                debuga_more("sort -T \"%s\" -t \"\t\" -k 4,4 -k 1,1 -k 2,2 -o \"%s/%s.user_log\" \"%s/%s.user_unsort\"",
                                        tmp, tmp, user, tmp, user);
                exit(EXIT_FAILURE);
        }
        cstatus=system(csort);
        if (!WIFEXITED(cstatus) || WEXITSTATUS(cstatus)) {
-               debuga(_("sort command return status %d\n"),WEXITSTATUS(cstatus));
-               debuga(_("sort command: %s\n"),csort);
+               debuga(__FILE__,__LINE__,_("sort command return status %d\n"),WEXITSTATUS(cstatus));
+               debuga(__FILE__,__LINE__,_("sort command: %s\n"),csort);
                exit(EXIT_FAILURE);
        }
        if (snprintf(csort,sizeof(csort),"%s/%s.user_unsort",tmp,user)>=sizeof(csort)) {
-               debuga(_("User name too long to manufacture file name "));
+               debuga(__FILE__,__LINE__,_("User name too long to manufacture file name "));
                debuga_more("%s/%s.user_unsort\n",tmp,user);
                exit(EXIT_FAILURE);
        }
        if (!KeepTempLog && unlink(csort)) {
-               debuga(_("Cannot delete \"%s\": %s\n"),csort,strerror(errno));
+               debuga(__FILE__,__LINE__,_("Cannot delete \"%s\": %s\n"),csort,strerror(errno));
                exit(EXIT_FAILURE);
        }