Browse Source

code formatting, nothing important

sisyphus
Dustin Falgout 9 years ago
parent
commit
6d79386308
  1. 8
      src/lightdm-webkit2-greeter-ext.c

8
src/lightdm-webkit2-greeter-ext.c

@ -1137,6 +1137,7 @@ get_conf_bool_cb(JSContextRef context,
return JSValueMakeBoolean(context, value); return JSValueMakeBoolean(context, value);
} }
static JSValueRef static JSValueRef
get_dirlist_cb(JSContextRef context, get_dirlist_cb(JSContextRef context,
JSObjectRef function, JSObjectRef function,
@ -1144,6 +1145,7 @@ get_dirlist_cb(JSContextRef context,
size_t argumentCount, size_t argumentCount,
const JSValueRef arguments[], const JSValueRef arguments[],
JSValueRef *exception) { JSValueRef *exception) {
JSObjectRef array; JSObjectRef array;
guint n_entries = 0; guint n_entries = 0;
JSValueRef *args = NULL; JSValueRef *args = NULL;
@ -1157,6 +1159,7 @@ get_dirlist_cb(JSContextRef context,
} }
path = arg_to_string(context, arguments[0], exception); path = arg_to_string(context, arguments[0], exception);
if (!path) { if (!path) {
return JSValueMakeNull(context); return JSValueMakeNull(context);
} }
@ -1170,9 +1173,8 @@ get_dirlist_cb(JSContextRef context,
} }
/* /*
* Create the lis of the directory entries * Create the list of the directory entries
*/ */
while ( ( dirent = g_dir_read_name(dir) ) != NULL) { while ( ( dirent = g_dir_read_name(dir) ) != NULL) {
n_entries++; n_entries++;
args = g_realloc( args, sizeof(JSValueRef) * ( n_entries + 1 ) ); args = g_realloc( args, sizeof(JSValueRef) * ( n_entries + 1 ) );
@ -1184,7 +1186,9 @@ get_dirlist_cb(JSContextRef context,
g_dir_close(dir); g_dir_close(dir);
array = JSObjectMakeArray(context, n_entries, args, exception); array = JSObjectMakeArray(context, n_entries, args, exception);
g_free(args); g_free(args);
if (array == NULL) { if (array == NULL) {
return JSValueMakeNull(context); return JSValueMakeNull(context);
} else { } else {

Loading…
Cancel
Save