rename `NativeString` to `CString`
[nit.git] / contrib / sort_downloads / src / sort_downloads.nit
index ba96d5d..9b70e83 100755 (executable)
@@ -26,7 +26,8 @@ module sort_downloads
 import opts
 
 `{
-#include <errno.h>
+       #include <errno.h>
+       #include <string.h>
 `}
 
 # Local config
@@ -62,11 +63,11 @@ redef class String
        end
 
        # Returns null on success
-       fun file_rename_to(dest: String): nullable String import String::to_cstring,
-       NativeString::to_s, String as nullable `{
-               int res = rename(String_to_cstring(recv), String_to_cstring(dest));
+       fun file_rename_to(dest: String): nullable String import String.to_cstring,
+       CString.to_s, String.as nullable `{
+               int res = rename(String_to_cstring(self), String_to_cstring(dest));
                if (res == 0) return null_String();
-               return String_as_nullable(NativeString_to_s(strerror(errno)));
+               return String_as_nullable(CString_to_s(strerror(errno)));
        `}
 
        # Replace `~` by the path to the home diretory
@@ -84,7 +85,7 @@ end
 class PatternWithDir
        super BM_Pattern
 
-       var dir: String
+       var dir: String is noinit
 
        init with_dir(motif, dir: String)
        do